Help With Xpath

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LukeD
    New Member
    • Apr 2007
    • 2

    Help With Xpath

    Hello,
    I need to parse and find certain records where the record name contains a certain string.
    For example, I have this XML:


    Code:
    <B04_CALIPER>
    <AAIA_ID>1368109</AAIA_ID>
    <MODEL>A4 QUATTRO</MODEL>
    <Nameplate/>
    <Submodel/>
    <Appl>Caliper to Bracket</Appl>
    <FTorq>18</FTorq>
    <RTorq>22</RTorq>
    <Note/>
    </B04_CALIPER>
    −
    <B06_LINING>
    <AAIA_ID>1368109</AAIA_ID>
    <Model_Name>A4 QUATTRO</Model_Name>
    <Nameplate/>
    <Submodel>STD Caliper</Submodel>
    <Loc>F</Loc>
    <Loc_Text>Front</Loc_Text>
    <MiniPad>.080</MiniPad>
    <MinShoe/>
    <NotP/>
    <NotS/>
    </B06_LINING>
    −
    <B06_LINING>
    <AAIA_ID>1368109</AAIA_ID>
    <Model_Name>A4 QUATTRO</Model_Name>
    <Nameplate/>
    <Submodel/>
    <Loc>R</Loc>
    <Loc_Text>Rear</Loc_Text>
    <MiniPad>.276</MiniPad>
    <MinShoe/>
    <NotP>Includes backing plate. </NotP>
    <NotS/>
    </B06_LINING>
    -<B06_LINING>
    <AAIA_ID>1368109</AAIA_ID>
    <Model_Name>A4 QUATTRO</Model_Name>
    <Nameplate/>
    <Submodel>W/ Dual Piston</Submodel>
    <Loc>F</Loc>
    <Loc_Text>Front</Loc_Text>
    <MiniPad>.120</MiniPad>
    <MinShoe/>
    <NotP/>
    <NotS/>
    </B06_LINING>
    −
    <B07_ROTOR>
    <AAIA_ID>1368109</AAIA_ID>
    <Model_Name>A4 QUATTRO</Model_Name>
    <Nameplate/>
    <Submodel/>
    <Pos>R</Pos>
    <Pos_Text>Rear</Pos_Text>
    <MaxPar>NS</MaxPar>
    <NotP/>
    <Runout>NS</Runout>
    <NotR/>
    <NomT>.390</NomT>
    <NotT/>
    <MinMach>NS</MinMach>
    <NotM/>
    <Discard>.310</Discard>
    <NotD/>
    <Finish>NS</Finish>
    <NotF/>
    </B07_ROTOR>
    How do I go about selecting all nodes that have the keyword LINING in the record name using XPATH?
    The only way I could figure out was to use the exact name which is B06_LINING, but I need to be able to search just by LINING. Any suggestions?
  • dorinbogdan
    Recognized Expert Contributor
    • Feb 2007
    • 839

    #2
    Welcome to TheScripts TSDN....

    What language do you use for it? C#, Java, XSL ....?

    Dorin.

    Comment

    • dorinbogdan
      Recognized Expert Contributor
      • Feb 2007
      • 839

      #3
      Also, please post your current code to help us testing/analyzing it.

      Comment

      • LukeD
        New Member
        • Apr 2007
        • 2

        #4
        Hello,
        Thanks for the reply. This is in VB6. There is no current code, but here is what Im trying to get at:

        if I do the following:

        Dim oNodeListBrake As IXMLDOMNodeList
        Dim oNodeListQL As IXMLDOMNodeList

        Set oNodeListBrake = oXMLCCBrake.sel ectNodes("//B04_CALIPER")

        I get all the B04_CALIPER nodes back, but what Im trying to get at is this:

        Dim oNodeListBrake As IXMLDOMNodeList
        Dim oNodeListQL As IXMLDOMNodeList

        Set oNodeListBrake = oXMLCCBrake.sel ectNodes("//*CALIPER*")

        ie. Any nodes that have the word Caliper in the name.

        Thanks

        Comment

        Working...