User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Oct 2007
Posts: 12
Reputation: kzubair96 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kzubair96 kzubair96 is offline Offline
Newbie Poster

Question Xpath

  #1  
Nov 16th, 2007
Ive heard about Xpath a couple of times. Can someone explain me in detail what Xpath is?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: Xpath

  #2  
Nov 19th, 2007
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.
Reply With Quote  
Join Date: Oct 2007
Posts: 12
Reputation: kzubair96 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kzubair96 kzubair96 is offline Offline
Newbie Poster

Re: Xpath

  #3  
Nov 20th, 2007
I have to work on XSLT. Do I have to know about XPath first for that?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: Xpath

  #4  
Nov 21st, 2007
XPath is a major element in the XSLT standard. Without XPath knowledge you will not be able to create XSLT documents.
Reply With Quote  
Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: Xpath

  #5  
Nov 21st, 2007
I am working with DB2 database and want to learn Xquery. I have some experience with XPath. Will it be helpful in learning Xquery?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: Xpath

  #6  
Nov 22nd, 2007
XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators. If you have already studied XPath you will have no problems with understanding XQuery.
Reply With Quote  
Join Date: Oct 2007
Posts: 31
Reputation: ssahil11 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
ssahil11 ssahil11 is offline Offline
Light Poster

Re: Xpath

  #7  
Dec 5th, 2007
How do I return an XML value by evaluating XPath expression?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: Xpath

  #8  
Dec 6th, 2007
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
Reply With Quote  
Join Date: Oct 2007
Posts: 12
Reputation: kzubair96 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
kzubair96 kzubair96 is offline Offline
Newbie Poster

Re: Xpath

  #9  
Dec 10th, 2007
What are general DB2's XPath syntaxes?
Reply With Quote  
Join Date: Oct 2007
Posts: 76
Reputation: dilasing is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dilasing dilasing is offline Offline
Junior Poster in Training

Re: Xpath

  #10  
Dec 10th, 2007
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb XML, XSLT and XPATH Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the XML, XSLT and XPATH Forum

All times are GMT -4. The time now is 1:15 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC