This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: re: generation of qnames/prefixes in content and value [was xbind:module....]
- To: "Curt Arnold" <carnold at houston dot rr dot com>
- Subject: Re: [xsl] re: generation of qnames/prefixes in content and value [was xbind:module....]
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Sun, 4 Mar 2001 11:07:50 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <Pine.LNX.4.21.0103030431210.2671-100000@clarkevans.com><002301c0a409$81dbcae0$7c021942@houston.rr.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Curt,
>> Without the ability to specify prefixes, then an XSLT stylesheet
>> which generates an XSLT stylesheet will be unable to declare script
>> items. Right? Or am I missing something again?
>
> 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. For example, XML Schema uses attribute
> values containing QNames to refer to types or elements defined in
> other schemas (for example, base="xsd:double") and XSLT 1.1 uses
> QNames to refer to extension behavior in expressions (i.e.
> ="{date:format(@date)}"
You and Clark make a good point about the use of prefixes (and
qualified names) in generated attribute values (or text nodes).
However, I don't think it's a problem as long as the namespaces that
you use are declared in the stylesheet.
If you have a namespace declared in the stylesheet, then any namespace
nodes on a particular literal result element or xsl:element are copied
to the result tree (modulo ones that you exclude with
extension-element-prefixes and exclude-result-prefixes).
For example, if I have my stylesheet:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
xmlns:my="my-namespace">
<xsl:template match="/">
...
<xsd:element name="foo" type="my:string" />
...
</xsl:template>
</xsl:stylesheet>
Then the namespace nodes for 'xsd' and 'my' prefixes are copied onto
the xsd:element element, so the namespace declaration for the 'my'
namespace will be present in the output, and the value 'my:string'
will be resolved as it should be.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list