bug with <x:copy> on namespaced attributes
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Mon Dec 26, 2005 12:35 pm
bug with <x:copy> on namespaced attributes
hi,
i've some issue with xsl transform when i'm using <x:copy> tag.
I don't know if it is a know bug or if i do something wrong.
It seem like Xalan processor can't copy namespaced attributes.
I've give an example for more understanding.
My xml File
My xsl File (xsl.xsl)
Result in browser
anyone can help ??
Thanks in advance
Fabrice.
i've some issue with xsl transform when i'm using <x:copy> tag.
I don't know if it is a know bug or if i do something wrong.
It seem like Xalan processor can't copy namespaced attributes.
I've give an example for more understanding.
My xml File
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="xsl.xsl" type="text/xsl"?>
<tag xmlns:test1="namespace" test2="noNamespace" />
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/tag">
<xsl:copy>
namespaced attribute : <xsl:apply-templates select="@xmlns:test1"/>
</xsl:copy>
|||
<xsl:copy>
normal attribute : <xsl:apply-templates select="@test2"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Code: Select all
namespaced attribute : ||| normal attribute : noNamespace
Thanks in advance
Fabrice.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Fabrice,
The namespace declarations look like attributes but they are not attributes. In fact I cannot get your sample stylesheet to work neither with Xalan nor with Saxon.
You can access the namespace declarations on the namespace axis like below:
This will give you
Best Regards,
George
The namespace declarations look like attributes but they are not attributes. In fact I cannot get your sample stylesheet to work neither with Xalan nor with Saxon.
You can access the namespace declarations on the namespace axis like below:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/tag">
namespaces:
<xsl:for-each select="namespace::*">
[<xsl:value-of select="."/>]
</xsl:for-each>
test2:<xsl:value-of select="@test2"/>
</xsl:template>
</xsl:stylesheet>
Code: Select all
namespaces:
[http://www.w3.org/XML/1998/namespace]
[namespace]
test2:noNamespace
George
-
- Posts: 2
- Joined: Mon Dec 26, 2005 12:35 pm
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
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