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(_at_)engrm(_dot_)com
- http://engrm.com/blogometer/index.html
- http://engrm.com/blogometer/rss.2.0.xml
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--