473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 2485


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
3
by: JT | last post by:
Hi all, I have a pretty basic question... I have a method (below) which uses ExecuteXMLReader to load the output from a FOR XML Explicit stored procedure into an XML document, and then save the...
5
by: David Thielen | last post by:
Hi; I set up my xml as follows: XmlDocument xml = new XmlDocument(); xml.Load(File.Open("data.xml", FileMode.Open, FileAccess.Read)); XmlNamespaceManager context = new...
2
by: VanOrton | last post by:
Hi all, When XercesDOMParser parses an XML document with a Schema instance, by default it adds all missing default and fixed attributes. I have the impression though that it misses the...
2
by: Max | last post by:
Hello everyone! I have 2 questions: - Is the default-default namespace "http://www.w3.org/2000/xmlns/" or an empty string("")? - Is the localname property for element without prefix the name...
7
by: Bilal | last post by:
Hello all, I came across this problem while working out the bugs in my identity trasnformation stylesheets but sidestepped it for later to see if there is an easier/better solution. This is...
3
by: Jason Mobarak | last post by:
Hello -- I'm attempting to get a handle on how to do xpath queries with System.Xml -- so far the biggest hurdle has been how to deal with a default namespace. If I use the test xml: <?xml...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.