This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Specifying namespaces with prefixes or URIs (Was: Re: html tags in xml elements)
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: Peter Davis <pdavis152 at attbi dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 1 Mar 2002 11:23:13 +0000
- Subject: Re: Specifying namespaces with prefixes or URIs (Was: Re: [xsl] html tags in xml elements)
- Organization: Jeni Tennison Consulting Ltd
- References: <Pine.LNX.4.33.0202281343470.9786-100000@DHCP5-21.narus.com><E16gc8j-0004Sq-00@pdavis.cx> <96162160915.20020301095515@jenitennison.com><E16gkpG-0005w9-00@pdavis.cx>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Peter,
> <offtopic from="xslt">
> I've never actually used xs:any, but reading the schema spec had an example
> with <xs:any namespace="##prefix"/>. Was I just reading it wrong? Thanks
> for your explanation, btw.
The XML Schema spec gives the following syntax:
<any
id = ID
maxOccurs = (nonNegativeInteger | unbounded) : 1
minOccurs = nonNegativeInteger : 1
namespace = ((##any | ##other) |
List of (anyURI | (##targetNamespace | ##local)) ) : ##any
processContents = (lax | skip | strict) : strict
{any attributes with non-schema namespace . . .}>
Content: (annotation?)
</any>
http://www.w3.org/TR/xmlschema-1/#declare-openness
The literal values ##any, ##other, ##targetNamespace and ##local
aren't specifying prefixes, but are specifying special values:
- ##any means any namespace at all
- ##other means any namespace aside from the target namespace of the
schema or no namespace
- ##targetNamespace means the target namespace of the schema
- ##local means no namespace
Other namespaces fall under the 'anyURI' category, which is the
namespace URI.
So for example:
<xs:any namespace="##targetNamespace ##local
http://www.w3.org/1999/xhtml" />
Means any element from the target namespace of the schema, no
namespace (local), or the XHTML namespace.
I think that they chose keywords beginning with ## because you can't
have URIs that start with ## (although you can have URIs that start
with # - fragment identifiers).
In XSLT, because we list prefixes instead, you can use #default for
the default namespace - we can use only one # because unlike URIs,
prefixes can't start with a #.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list