469,275 Members | 1,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Help With Xpath

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


Expand|Select|Wrap|Line Numbers
  1. <B04_CALIPER>
  2. <AAIA_ID>1368109</AAIA_ID>
  3. <MODEL>A4 QUATTRO</MODEL>
  4. <Nameplate/>
  5. <Submodel/>
  6. <Appl>Caliper to Bracket</Appl>
  7. <FTorq>18</FTorq>
  8. <RTorq>22</RTorq>
  9. <Note/>
  10. </B04_CALIPER>
  11. <B06_LINING>
  12. <AAIA_ID>1368109</AAIA_ID>
  13. <Model_Name>A4 QUATTRO</Model_Name>
  14. <Nameplate/>
  15. <Submodel>STD Caliper</Submodel>
  16. <Loc>F</Loc>
  17. <Loc_Text>Front</Loc_Text>
  18. <MiniPad>.080</MiniPad>
  19. <MinShoe/>
  20. <NotP/>
  21. <NotS/>
  22. </B06_LINING>
  23. <B06_LINING>
  24. <AAIA_ID>1368109</AAIA_ID>
  25. <Model_Name>A4 QUATTRO</Model_Name>
  26. <Nameplate/>
  27. <Submodel/>
  28. <Loc>R</Loc>
  29. <Loc_Text>Rear</Loc_Text>
  30. <MiniPad>.276</MiniPad>
  31. <MinShoe/>
  32. <NotP>Includes backing plate. </NotP>
  33. <NotS/>
  34. </B06_LINING>
  35. -<B06_LINING>
  36. <AAIA_ID>1368109</AAIA_ID>
  37. <Model_Name>A4 QUATTRO</Model_Name>
  38. <Nameplate/>
  39. <Submodel>W/ Dual Piston</Submodel>
  40. <Loc>F</Loc>
  41. <Loc_Text>Front</Loc_Text>
  42. <MiniPad>.120</MiniPad>
  43. <MinShoe/>
  44. <NotP/>
  45. <NotS/>
  46. </B06_LINING>
  47. <B07_ROTOR>
  48. <AAIA_ID>1368109</AAIA_ID>
  49. <Model_Name>A4 QUATTRO</Model_Name>
  50. <Nameplate/>
  51. <Submodel/>
  52. <Pos>R</Pos>
  53. <Pos_Text>Rear</Pos_Text>
  54. <MaxPar>NS</MaxPar>
  55. <NotP/>
  56. <Runout>NS</Runout>
  57. <NotR/>
  58. <NomT>.390</NomT>
  59. <NotT/>
  60. <MinMach>NS</MinMach>
  61. <NotM/>
  62. <Discard>.310</Discard>
  63. <NotD/>
  64. <Finish>NS</Finish>
  65. <NotF/>
  66. </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?
Apr 19 '07 #1
3 1272
dorinbogdan
839 Expert 512MB
Welcome to TheScripts TSDN....

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

Dorin.
Apr 20 '07 #2
dorinbogdan
839 Expert 512MB
Also, please post your current code to help us testing/analyzing it.
Apr 20 '07 #3
LukeD
2
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.selectNodes("//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.selectNodes("//*CALIPER*")

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

Thanks
Apr 20 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Thierry Lam | last post: by
4 posts views Thread by Iain A. Mcleod | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.