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

Re: import entire tags

Subject: Re: import entire tags
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sat, 18 Jan 2003 02:08:22 +0100
xml import merge namespace
Johannes.Becker@xxxxxx wrote:
The page source looks now like this:
      ...
      <option xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1" xmlns:esql
="http://apache.org/cocoon/SQL/v2" xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-request="http://apache.org/xsp/request/2.0" value
="17">blabla</option>

Is there a simple way (I mean "short code") to avoid this kind of output?

xsl:copy-of unconditionally copies namespace nodes. You try to can avoid this by using element constructors instead of copying: <xsl:template match="*"> <xsl:element name="name()" namespace="namespace-uri()"> <xsl:copy-of select="@*"> <xsl:apply-templates/> </xsl:element> </xsl:template> Beware, untested, check against the spec before use. You can omit the namespace bit if your elements are always in the default namespace.

You can try to merge the stuff above somehow into your existing
transformation, or use it as a separate filter transformation
in the pipeline. Either way costs performance.
Another way would be to write a simple customized transformation
stripping superflous namespaces directly from the SAX events.
There are examples of similar transformers in the Cocoon
distribution (somewhere, well hidden). This should be the most
performant solution.

J.Pietschmann


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.