469,319 Members | 2,423 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,319 developers. It's quick & easy.

default namespace prefix

HELLO

For the top root element of my schema file,
i want to declare following attribute:

<xs:attribute name="xmlns:m" type="xs:string"
default="http://www.w3.org/1998/Math/MathML"/>

But this seems to be not possible with XML Schema, xerces
says that a prefix is not allowed in the name attribute.

This is however possible with DTD.

For any idea,

THX
Jul 20 '05 #1
1 2292


indo3 wrote:

For the top root element of my schema file,
i want to declare following attribute:

<xs:attribute name="xmlns:m" type="xs:string"
default="http://www.w3.org/1998/Math/MathML"/>

But this seems to be not possible with XML Schema, xerces
says that a prefix is not allowed in the name attribute.

This is however possible with DTD.


Right, you need a schema per namespace and then you can use
<xs:attribute ref="prefix:attributename" />
to reference the attribute defined in the schema for the other namespace.
However you want an attribute xmlns:m and I think those can't be
specified as
http://www.w3.org/TR/xmlschema-1/#no-xmlns
says

Schema Component Constraint: xmlns Not Allowed
The {name} of an attribute declaration must not match xmlns.

NOTE: The {name} of an attribute is an ∑NCName∑, which implicitly
prohibits attribute declarations of the form xmlns:*.

And
http://www.w3.org/TR/xmlschema-1/#At...ration_details
says the following:

[XML-Infoset] distinguishes attributes with names such as xmlns or
xmlns:xsl from ordinary attributes, identifying them as [namespace
attributes]. Accordingly, it is unnecessary and in fact not possible for
schemas to contain attribute declarations corresponding to such
namespace declarations, see xmlns Not Allowed (ß3.2.6). No means is
provided in this specification to supply a default value for a namespace
declaration.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by John L. Clark | last post: by
3 posts views Thread by Mike Dickens | last post: by
3 posts views Thread by JT | last post: by
5 posts views Thread by David Thielen | last post: by
3 posts views Thread by Jason Mobarak | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.