473,371 Members | 1,507 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,371 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 2483


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,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.