xsl-list
[Top] [All Lists]

Re: Unwanted Prefixes in Output

2005-09-21 02:31:44
* Alan <alan-xsl-list(_at_)engrm(_dot_)com> [2005-09-21 04:30]:
* Alan <alan-xsl-list(_at_)engrm(_dot_)com> [2005-09-21 04:24]:
    Probably common problem with namespace emissions. Tried to cut
    it down to the basics.

I'd like to omit "xmlns:foo" namespace declaration where it will not
be referenced, like under atom:updated.

    Should note that the saved documents can contain any namespace,
    so I can't add xmlns:foo declaration to my stylesheet, but I'd
    like to have my namespaces namespace normal.

    http://www.flightlab.com/~joe/sgml/sanity.txt

    Cheers.

    I'm talking to myself now. :^)

    I found that this removes unnecessary namespace declarations...

      <xsl:template match="atom:*" mode="copy-entry">
        <xsl:element name="atom:{local-name(.)}">
          <xsl:copy-of select="@*"/>
          <xsl:apply-templates select="node()" mode="copy-entry"/>
        </xsl:element>
      </xsl:template>

    And the "xmlns:foo" only appears on "foo" namespace elements.

    This is pretty close to "namespace normal".

    Can it get any better?

--
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>
--~--