[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Unwanted Prefixes in Output

Subject: Unwanted Prefixes in Output
From: Alan <alan-xsl-list@xxxxxxxxx>
Date: Wed, 21 Sep 2005 04:24:29 -0400
xmlns atom
    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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.