473,414 Members | 1,936 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,414 software developers and data experts.

Why are no namespace attributes validated by schema.

I apologise if this has been asked before, it is a bit hard to search
for.

I have an xml schema which defines the elements in the namespace
"urn:dummy". The schema does not contain any attribute
definitions/declarations.

The instance XML however gets transformed at runtime with the result
that a label attribute is added to each element.

An example of my instance XML is below

<?xml version="1.0"?>
<ROOTSTUB xmlns="urn:dummy">
<a label="Name">login</a>
<b label="derivation">restriction</b>
<c label="XML Data Type">NCName</c>
<d label="Minimum Field Length">6</d>
</ROOTSTUB>

Post transformation, errors are being thrown up because the validating
XML schema has no attribute definitions.

My question is given that the label attributes are not in any
namespace why are they being validated by the XML schema?
Jul 20 '05 #1
2 2263


wooks wrote:
I apologise if this has been asked before, it is a bit hard to search
for.

I have an xml schema which defines the elements in the namespace
"urn:dummy". The schema does not contain any attribute
definitions/declarations.
Well then the elements are not allowed to have attributes.
The instance XML however gets transformed at runtime with the result
that a label attribute is added to each element.

An example of my instance XML is below

<?xml version="1.0"?>
<ROOTSTUB xmlns="urn:dummy">
<a label="Name">login</a>
<b label="derivation">restriction</b>
<c label="XML Data Type">NCName</c>
<d label="Minimum Field Length">6</d>
</ROOTSTUB>

Post transformation, errors are being thrown up because the validating
XML schema has no attribute definitions.

My question is given that the label attributes are not in any
namespace why are they being validated by the XML schema?


Because the schema defines the elements, you would need to allow
elements if you want to add them.

--

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

Jul 20 '05 #2
In article <88**************************@posting.google.com >,
wooks <wo****@hotmail.com> wrote:
Post transformation, errors are being thrown up because the validating
XML schema has no attribute definitions.

My question is given that the label attributes are not in any
namespace why are they being validated by the XML schema?


There are two issues: are the attributes themselves valid? and are the
elements that they are attached to valid? Even if you don't want to
validate the attributes themselves, you have to declare that the
elements are allowed to have such attributes.

You need to use an attribute wildcard, and specify lax validation, e.g.

<anyAttribute namespace="##local" processContents="lax"/>

-- Richard
Jul 20 '05 #3

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...
25
by: kj | last post by:
Consider the following XML document: <?xml version='1.0' encoding='UTF-8'?> <bar:foo xmlns:bar='someuri'> <baz/> </bar:foo> What namespace does baz belong to? What is this namespace bound...
1
by: indo3 | last post by:
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...
2
by: Zombie | last post by:
Hi all, I wish to create a namespace other than the default one. Let's say, the Schema looks like: ----------------------------------------------------------------------- <?xml version="1.0"...
6
by: Martin | last post by:
Hi, I have a xml file like the one below <?xml version="1.0" encoding="utf-8"?><e1 xmlns:e1="http://tempuri.org/Source1.xsd" e1:att1="1" e1:att2="2" e1:rest="345"/> If I try to create a...
3
by: George | last post by:
I am currently developing an xbrl validation software that takes an xml instance file and a lot of schemas(xsd files) and validates it against the xsd files. I am using Visual basic in visual...
13
by: Axel Dahmen | last post by:
Hi, I've got a question on namespaces. After reading http://www.w3.org/TR/xml-names11 I still don't understand how namespaces are applied to attributes - particularly in regard to how processing...
1
by: Tanja Schaettler | last post by:
Hello! I have an existing SOAP message which looks like: <?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"...
3
by: Jon | last post by:
I have an xml document like so... <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0" xmlns:ng="http://newsgator.com/schema/extensions"> <channel> <title></title> <link></link>...
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
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.