|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Unwanted Prefixes in Output
Probably common problem with namespace emissions. Tried to cut
it down to the basics.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:atom="http://www.w3.org/2005/Atom">
version="2.0">
<xsl:template match="node()" mode="copy-entry"
<xsl:template match="atom:entry">
<atom:entry>
<xsl:apply-templates
select="document('file://saved-entry.xml')/atom:entry/node()"
mode="copy-entry"/>
</atom:entry>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="atom:entry"/>
</xsl:template>
</xsl:stylesheet>
Input:
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom"/>
saved-entry.xml:
<atom:entry
xmlns:foo="tag:agtrz.com,2005:foo"
xmlns:atom="http://www.w3.org/2005/Atom">
<atom:updated>2005-09-20T10:23:32Z</atom:updated>
<foo:bar>fubar</foo:bar>
</atom:entry>
Output:
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
<atom:updated xmlns:foo="tag:agtrz.com,2005:foo">2005-09-20T10:23:32Z</atom:updated>
<foo:bar xmlns:foo="tag:agtrz.com,2005:foo">fubar</foo:bar>
</atom:entry>
I'd like to omit "xmlns:foo" namespace declaration where it will not
be referenced, like under atom:updated.
Cheers.
--
Alan Gutierrez - alan@xxxxxxxxx
- http://engrm.com/blogometer/index.html
- http://engrm.com/blogometer/rss.2.0.xml
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








