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

RE: re: generation of qnames/prefixes in content and v

Subject: RE: re: generation of qnames/prefixes in content and value [was xbind:module....]
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Mon, 5 Mar 2001 14:25:13 -0000
javascript qname generation
> Actually, as far I can tell, it would also prevent the
> generation of any XML
> application that used qualified names in contexts other than tag or
> attribute names.
>

Actually it *is* possible to safely output a QName as an attribute value,
given the statements in the XSLT 1.0 errata about the effect of copying a
namespace node. It's pretty obscure territory though, and you may find that
not all processors get it right.

You can produce a namespace node in the result tree by copying a namespace
node either from a source document or the stylesheet. Normally namespace
nodes are copied when a source element is copied using <xsl:copy> or when a
literal result element in the stylesheet is copied; however one of the
errata makes it clear that if there are no conflicts, you can also copy a
namespace node using <xsl:copy> or <xsl:copy-of>, which means you can inject
a new namespace node into the result by having a secondary source document

   <dummy xmlns:ppp="some.namespace.uri"/>

and doing <xsl:copy-of select="document('dummy.xml')/*/namespace::ppp"/>

When a namespace node is present on the result tree, the serializer must
output a namespace declaration for it, and it is not allowed to change
either the prefix or the URI.

This means you can safely use this prefix in the value of a generated
attribute.

Mike Kay


 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.