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

Re: superfluous namespace declarations with xsl:elemen

Subject: Re: superfluous namespace declarations with xsl:element
From: Georges Schmitz <georges.schmitz@xxxxxxxxx>
Date: Tue, 10 Dec 2002 16:33:09 +0100
superfluous namespace
Michael Kay wrote:
>>How can I avoid, that with <xsl:element name="{name()}"> and
>>a namespace-prefix in this name, I get a namespace
>>declaration in my output on mostly all elements created this
>>way? Is there some strategy, to get the namespace declaration
>>only once in my root element?
>>
>>Transformers work quite differently on this point (eg. msxslt
>>apparently avoids itself superfluous declarations), so I'm
>>wondering if there is a general approach at all.
>
>
> Most XSLT processors will avoid outputting redundant namespace
> declarations, but there is no way of forcing them to do so.
>
> What processor are you using and what output are you getting?

xsltproc, msxslt, saxon, xalan

Well, your saxon avoids redundant namespace declarations as well! :-)

Because of speed reasons, I often use xsltproc to test my stylesheets
during development process. But little by little, I get the
impression, that xsltproc is not such a good choice for this task. To
many differences from standard behavior occurred in the last time.

> Why are you using <xsl:element name="{name()}"> rather than <xsl:copy>?

I have to manipulate the text content of these nodes (for the ones,
that have "[]" around themselves, I use a separate lookup table,
replacing the actual [value] by the one I found).

...
<arc:ReferenceSet>
 <arc:Reference linkId="[parentdokid]" refType="parent-pointer"/>
</arc:ReferenceSet>
...
<arc:KeywordSet>
 <arc:Keyword>[selektormax]</arc:Keyword>
...

Regards,
Georges

> There is an important difference: xsl:copy puts the new element in the
> same namespace as the original, whereas <xsl:element name="{name()}">
> looks for a namespace declaration in the stylesheet that has the same
> namespace prefix as the original name in the source document.
>
> Michael Kay
> Software AG
> home: Michael.H.Kay@xxxxxxxxxxxx
> work: Michael.Kay@xxxxxxxxxxxxxx


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.