473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1370
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

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

Similar topics

0
by: gael.pegliasco | last post by:
Hi, How are you dear and nice helper :) ? I'm trying to test xpath with this simple program : import xml.dom.minidom from xml.xpath.Context import Context import xml.xpath
3
by: Thierry Lam | last post by:
Let's say I have the following xml tag: <para role="success">1</para> I can't figure out what kind of python xml.dom codes I should invoke to read the data 1? Any help please? Thanks...
0
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema"...
2
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema"...
4
by: Iain A. Mcleod | last post by:
Hi I'm stuck with the following schema validation problem in VS.NET 2003: I have two types of xml document and related schema: project and projectCollection. A projectcollection is just a set...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.