xpath-default-namespace getting in the way
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
xpath-default-namespace getting in the way
I am taking over a project that has some existing stylesheets.
One of them has this at the top
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.tei-c.org/ns/1.0"
xpath-default-namespace="http://www.tei-c.org/ns/1.0"
xmlns:ta="http://concord-works.com/tei/augment-functions" exclude-result-prefixes="xs ta" version="2.0">
The sheet works fine processing the existing tei documents.
My problem with it is that I now need to use two source documents accessing the second with the doc() command. This works fine except that I can't access anything in the document. The document is just data contained in plain xml, no dtd, not tei, etc.. If I remove the xpath-default-namespace line from above I can access the data in the second document, but then many of the templates are not recognized during processing because the match="name" doesn't have tei: prepended to them.
My question: Is there a way I can fix this without going through the entire style sheet and finding which match"names" need to have tei: added?
thanks,
Scott
One of them has this at the top
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.tei-c.org/ns/1.0"
xpath-default-namespace="http://www.tei-c.org/ns/1.0"
xmlns:ta="http://concord-works.com/tei/augment-functions" exclude-result-prefixes="xs ta" version="2.0">
The sheet works fine processing the existing tei documents.
My problem with it is that I now need to use two source documents accessing the second with the doc() command. This works fine except that I can't access anything in the document. The document is just data contained in plain xml, no dtd, not tei, etc.. If I remove the xpath-default-namespace line from above I can access the data in the second document, but then many of the templates are not recognized during processing because the match="name" doesn't have tei: prepended to them.
My question: Is there a way I can fix this without going through the entire style sheet and finding which match"names" need to have tei: added?
thanks,
Scott
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: xpath-default-namespace getting in the way
Hi,
The xpath-default-namespace value is inherited from the closer ancestor that defines it. So, just add xpath-default-namespace="" on the templates that match content from the document from no namespace to reset the XPath default namespace to no namespace.
Best Regards,
George
The xpath-default-namespace value is inherited from the closer ancestor that defines it. So, just add xpath-default-namespace="" on the templates that match content from the document from no namespace to reset the XPath default namespace to no namespace.
Best Regards,
George
George Cristian Bina
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