objXML.SelectSingleNode
Jeg vil have koden til at læse fra unit elementet, som jeg vil bruge til en if statement. Kan nogen hjælpe mig ??'Koden
Dim objXML
Dim objXSL
Dim strHTML
'Load the XML File
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.load(Server.MapPath("nyt.xml"))
'Load the XSL File for rendering data in tables
Set objXSL = Server.CreateObject("Microsoft.XMLDOM")
objXSL.async = False
objXSL.load(Server.MapPath("xmlxsl.xsl"))
Dim iUnit, sUnit
iUnit = objXML.selectSingleNode("//location/fc_day/parameter/unit")
For i=0 TO UBound(iUnit)
sUnit = sUnit & " - " & iUnit(i)
Next
Response.Write sUnit
' Transform the XML file using the XSL stylesheet
strHTML = objXML.transformNode(objXSL)
Set objXML = Nothing
Set objXSL = Nothing
' example of nyt.xml document
<location>
<fc_day>
<parameter>
<unit>13.1</unit>
</parameter>
</fc_day>
</location>