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

RE: Unwanted Prefixes in Output

Subject: RE: Unwanted Prefixes in Output
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 21 Sep 2005 12:19:03 +0100
RE:  Unwanted Prefixes in Output
In XSLT 2.0 you could replace

<xsl:element name="atom:{local-name(.)}">

with

<xsl:copy copy-namespaces="no">

When you say "can it get any better", do you mean you want "better" output,
or you want a better way of producing the output you are now getting?

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Alan [mailto:alan-xsl-list@xxxxxxxxx] 
> Sent: 21 September 2005 10:32
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Unwanted Prefixes in Output
> 
> * Alan <alan-xsl-list@xxxxxxxxx> [2005-09-21 04:30]:
> > * Alan <alan-xsl-list@xxxxxxxxx> [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@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.