•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 423,401 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,594 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser: Programming Forums
Views: 3270 | Replies: 21
![]() |
•
•
Join Date: Oct 2007
Posts: 76
Reputation:
Rep Power: 1
Solved Threads: 0
XML Path Language (XPath), one of the most successful XML technologies, is a syntax and data model for addressing parts of an XML document. XPath includes over 100 built-in functions. There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more. XPath was designed to be used by XSLT, XPointer and other XML parsing software.
•
•
Join Date: Oct 2007
Posts: 76
Reputation:
Rep Power: 1
Solved Threads: 0
Use xmlquery scalar function to return XML value
select xmlquery('$n/doc[make = "Honda"]' passing po.appl_doc as "n") AS
"Result" FROM loan_application po;
You can read more at
http://publib.boulder.ibm.com/infoce...jsp?topic=/com.
ibm.db29.doc.sqlref/db2z_bif_xmlquery.htm
select xmlquery('$n/doc[make = "Honda"]' passing po.appl_doc as "n") AS
"Result" FROM loan_application po;
You can read more at
http://publib.boulder.ibm.com/infoce...jsp?topic=/com.
ibm.db29.doc.sqlref/db2z_bif_xmlquery.htm
•
•
Join Date: Oct 2007
Posts: 76
Reputation:
Rep Power: 1
Solved Threads: 0
These are W3 supported XPath syntaxes.
i) / = Represents the
XML root element.
ii) /tag1 = Represents the
element tag1 under root.
iii) /tag1/tag2/.../tagn = Represents an element with the
name tagn as the child of the descending chain from root, tag1, tag2,
through tagn-1.
iv) //tagn Represents any
element with the name tagn, where the double slashes denote zero or more
arbitrary tags.
v) /tag1//tagn Represents any element with
the name tagn, a child of an element with name
tag1 under root, where double slashes denote zero or more arbitrary tags.
vi) /tag1/tag2[tag3="5"] Represents an
element with the name tag3 has the value 5. tag3 is a child of an element
with name tag2 under tag1 and root.
vii) /tag1/tag2/@attr1 Represents the attribute attr1 of
an element tag2, which is a child of element tag1 under root.
viii) /tag1/tag2[@attr1="5"] Represents an element with the name tag2
whose attribute attr1 has the value 5. tag2 is a child of an element with
name tag1 under root.
ix)/tag1/tag2[@attr1="5"]/.../tagn Represents an element with the
name tagn, which is a child of the descending chain from root, tag1, tag2,
through tag n-1, where the attribute attr1 of tag2 has the value 5.
MTK can be downloaded at
http://www-306.ibm.com/software/data/db2/migration/mtk/. More information can be found at
http://www-1.ibm.com/support/docview...id=swg27009230.
i) / = Represents the
XML root element.
ii) /tag1 = Represents the
element tag1 under root.
iii) /tag1/tag2/.../tagn = Represents an element with the
name tagn as the child of the descending chain from root, tag1, tag2,
through tagn-1.
iv) //tagn Represents any
element with the name tagn, where the double slashes denote zero or more
arbitrary tags.
v) /tag1//tagn Represents any element with
the name tagn, a child of an element with name
tag1 under root, where double slashes denote zero or more arbitrary tags.
vi) /tag1/tag2[tag3="5"] Represents an
element with the name tag3 has the value 5. tag3 is a child of an element
with name tag2 under tag1 and root.
vii) /tag1/tag2/@attr1 Represents the attribute attr1 of
an element tag2, which is a child of element tag1 under root.
viii) /tag1/tag2[@attr1="5"] Represents an element with the name tag2
whose attribute attr1 has the value 5. tag2 is a child of an element with
name tag1 under root.
ix)/tag1/tag2[@attr1="5"]/.../tagn Represents an element with the
name tagn, which is a child of the descending chain from root, tag1, tag2,
through tag n-1, where the attribute attr1 of tag2 has the value 5.
MTK can be downloaded at
http://www-306.ibm.com/software/data/db2/migration/mtk/. More information can be found at
http://www-1.ibm.com/support/docview...id=swg27009230.
![]() |
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Looking for projects (Post your Resume)
- Xpath navigation in xml file (XML, XSLT and XPATH)
- What exactly is xml? (RSS, Web Services and SOAP)
- Pascal to VB (Pascal and Delphi)
- Converting Pascal to VB (Visual Basic 4 / 5 / 6)
- XSLT weird problem... [urgent] (RSS, Web Services and SOAP)
- Access unqualified XML element (C#)
- Inharits userControl (C#)
- Does XHTML have a future? (IT Technologies and Trends)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: SAX API Packages
- Next Thread: Xquery in DB2


Linear Mode