accessing akward attribute
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 2
- Joined: Wed Jul 26, 2006 1:30 am
accessing akward attribute
Hello
I have an xml document that looks similar to this template
<Library>
<book bookNum ="1" bookLength="300">
<author> some dude </author>
</book>
<book bookNum ="2" bookLength="100">
<author> anouther guy </author>
</book>
etc...
</Library>
My question is how do i get the attribute book Length from the first book?
The information is held on an XML database and my query looks like this
Select *
From MYTABLE
WHERE extractValue(OBJECT_VALUE, 'Library/book[1][@bookLength]') == 100;
I basically want to extract all the libraries from my database that contain a book of 100 pages.
Can anyone help?
Thanks
I have an xml document that looks similar to this template
<Library>
<book bookNum ="1" bookLength="300">
<author> some dude </author>
</book>
<book bookNum ="2" bookLength="100">
<author> anouther guy </author>
</book>
etc...
</Library>
My question is how do i get the attribute book Length from the first book?
The information is held on an XML database and my query looks like this
Select *
From MYTABLE
WHERE extractValue(OBJECT_VALUE, 'Library/book[1][@bookLength]') == 100;
I basically want to extract all the libraries from my database that contain a book of 100 pages.
Can anyone help?
Thanks
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Post by sorin_ristache »
Hello,
I think you need Library/book[1]/@bookLength instead of Library/book[1][@bookLength]. This is the expression for the bookLength attribute of the first book. If you want to test that there is at least a book with 100 pages you need Library/book[@bookLength = '100']
Regards,
Sorin
I think you need Library/book[1]/@bookLength instead of Library/book[1][@bookLength]. This is the expression for the bookLength attribute of the first book. If you want to test that there is at least a book with 100 pages you need Library/book[@bookLength = '100']
Regards,
Sorin
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service