default namespace in xsl
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Wed May 31, 2006 4:15 pm
default namespace in xsl
I receive an xml message with the following format:
I fail to apply transformation when using a stylesheet like:
I have tried adding the default namespace to the xsl (xmlns="Static/nme" ) without sucess.
However if I use a prefix xmlns:j="Static/nme" , I can reference my nodes with j:\
Is this a normal behavior and is there a way of using the default namespace in the xsl sheet to reference nodes and values?
Tx,
Mik.
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" ?>
<staticMessage xmlns="Static/nme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Static/nme ./StaticMessage.xsd">
...
</staticMessage>
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:value-of select="staticMessage/body/data"/>
</xsl:template>
</xsl:stylesheet>
However if I use a prefix xmlns:j="Static/nme" , I can reference my nodes with j:\
Is this a normal behavior and is there a way of using the default namespace in the xsl sheet to reference nodes and values?
Tx,
Mik.
-
- Site Admin
- Posts: 2097
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Mik,
Yes, this is the expected behavior, name tests without prefix in Path 1.0 are in no namespace, if you want a name test in some namespace you need to use a prefix.
XPath 2.0 allows specifying a default namespace for name tests and you can do that in a stylesheet with the xpath-default-namespace attribute.
Best Regards,
George
Yes, this is the expected behavior, name tests without prefix in Path 1.0 are in no namespace, if you want a name test in some namespace you need to use a prefix.
XPath 2.0 allows specifying a default namespace for name tests and you can do that in a stylesheet with the xpath-default-namespace attribute.
Best Regards,
George
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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