Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read xml using vbs to get name value

Status
Not open for further replies.

jloyzaga

Programmer
Feb 26, 2003
4
AU
I want to get the value pointed to by the "entityclass name=" thus giving me the value of "Event" - I have attached the file for this. I can get all the node text but I need the name value
I am using VBS

<vertex eid="423">
<attributes>
<attribute class="java.lang.String" key="type">entity</attribute>
<attribute class="com.flyinglogic.logicgraph.entityclass.EntityClass" key="entityClass">
<entityClass name="Event" uuid="34535235-b676-4a15-9c1b-5e22f3fb5056"/>
</attribute>
<attribute class="java.lang.String" key="title">User: Login</attribute>
<attribute class="com.arciem.FuzzyBoolean" key="confidence">
<fuzzyBoolean true="0.5"/>
</attribute>
<attribute class="com.flyinglogic.logicgraph.operator.FuzzyOrVertexOperator" key="forwardOperator">
<fuzzyOr/>
</attribute>
<attribute class="java.lang.String" key="note">[UC010] Stakeholders &amp; Interests: User wants to login or sign-up to access RTA online services.</attribute>
<attribute class="java.lang.Integer" key="noteNumber">9</attribute>
</attributes>
</vertex>
 
I have tried this but with no luck
Dim sFSpec : sFSpec = "J:\RTA\BT_UC_010.logic"
Dim oXDoc : Set oXDoc = CreateObject("Msxml2.DOMDocument")
oXDoc.setProperty "SelectionLanguage", "XPath"
oXDoc.async = False
oXDoc.load sFSpec

'If 5960 = oXDoc.ParseError Then
WScript.Echo sFSpec, "looks ok"
Dim sXPath : sXPath = "/flyingLogic/decisionGraph/logicGraph/graph/vertices/vertex/attributes/attribute[@key=""noteNumber""]"

'Dim sXPath : sXPath = "/flyingLogic/decisionGraph/logicGraph/graph/vertices/vertex[@eid=""423""]/attributes/attribute[@key=""noteNumber""]"
'+ "/''attribute[@key=""noteNumber""]"
Dim ndFnd : Set ndFnd = oXDoc.selectSingleNode( sXPath )
If ndFnd Is Nothing Then
WScript.Echo "|", sXPath, "| not found"
Else
WScript.Echo "found |" & ndFnd.getAttributeNode( "key" ).value & "|"
WScript.Echo "found |" & ndFnd.firstChild.text & "|"
End If
'Else
'WScript.Echo oXDoc.ParseError.Reason
'End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top