XPath tool and namespace
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 15
- Joined: Fri Mar 09, 2012 2:42 pm
XPath tool and namespace
Hello,
I'm trying to use the XPath tool on the IDE. I have a simple XML with namespace like this:
How do I get all row using XPath on the IDE ?.
TIA,
John
I'm trying to use the XPath tool on the IDE. I have a simple XML with namespace like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<tables xmlns="aaaaa">
<table xmlns="bbbbb">
<row>A</row>
<row>B</row>
</table>
</tables>
TIA,
John
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XPath tool and namespace
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XPath tool and namespace
How about:
'*:' means from any namespace
If you want to use a specific namespace, declare a prefix mapping for it in: Options > Preferences, XML > XSLT-FO-XQuery > XPath, Default prefix-namespace mappings
myns "bbbbb"
Then use in the XPath toolbar:
Or if you don't want any namespace mappings, there's always the possibility of specifying both the namespace and the local name, but it's messy:
If you have just started using XPath, there are some tutorials here:
http://www.w3schools.com/xpath/
Regards,
Adrian
Code: Select all
/tables/*:table
If you want to use a specific namespace, declare a prefix mapping for it in: Options > Preferences, XML > XSLT-FO-XQuery > XPath, Default prefix-namespace mappings
myns "bbbbb"
Then use in the XPath toolbar:
Code: Select all
/tables/myns:table
Code: Select all
/tables/*[namespace-uri()='bbbbb' and local-name()='table']
http://www.w3schools.com/xpath/
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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