473,406 Members | 2,439 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,406 software developers and data experts.

Schema: anyAttribute for several namespaces

Hi.

I would like to allow any attribute from two distinct namespaces on a
specific element.
However, it seems that anyAttribute can appear only once in a sequence
or a group.

Is there any way to achive this, besides allowing any attribute from
any namespace?

Thanks!

Amir.

Oct 29 '07 #1
3 1980
am*****@gmail.com wrote:
I would like to allow any attribute from two distinct namespaces on a
specific element.
However, it seems that anyAttribute can appear only once in a sequence
or a group.

Is there any way to achive this, besides allowing any attribute from
any namespace?
According to
<http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-anyAttribute>
the namespace attribute can be a whitespace separated list of URLs so using
<xs:element name="element-name">
<xs:complexType>
...
<xs:anyAttribute namespace="http://example.com/2007/ns1
http://example.com/2007/ns2"/>
</xs:complexType>
</xs:element>
should do

--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 29 '07 #2
On Oct 29, 7:25 pm, Martin Honnen <mahotr...@yahoo.dewrote:
amir...@gmail.com wrote:
I would like to allow any attribute from two distinct namespaces on a
specific element.
However, it seems that anyAttribute can appear only once in a sequence
or a group.
Is there any way to achive this, besides allowing any attribute from
any namespace?

According to
<http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#el...>
the namespace attribute can be a whitespace separated list of URLs so using
<xs:element name="element-name">
<xs:complexType>
...
<xs:anyAttribute namespace="http://example.com/2007/ns1http://example.com/2007/ns2"/>
</xs:complexType>
</xs:element>
should do

--

Martin Honnen
http://JavaScript.FAQTs.com/
Thanks Martin.
But, what if I wanted different processContents for each namespace?

Oct 31 '07 #3
On Oct 29, 7:25 pm, Martin Honnen <mahotr...@yahoo.dewrote:
amir...@gmail.com wrote:
I would like to allow any attribute from two distinct namespaces on a
specific element.
However, it seems that anyAttribute can appear only once in a sequence
or a group.
Is there any way to achive this, besides allowing any attribute from
any namespace?

According to
<http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#el...>
the namespace attribute can be a whitespace separated list of URLs so using
<xs:element name="element-name">
<xs:complexType>
...
<xs:anyAttribute namespace="http://example.com/2007/ns1http://example.com/2007/ns2"/>
</xs:complexType>
</xs:element>
should do

--

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

What if I wanted to have one namespace strict and the other skip?
Thanks,

Amir.

Oct 31 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: wooks | last post by:
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...
5
by: Zombie | last post by:
Hi, Can I have 2 namespaces in the same XML schema? In the schema, I wish to declare elements such that some of them belong to one namespace and others belong to a second namespace. Is this...
2
by: pohmart | last post by:
I am using Xerces 2.6.2 and SAX on Windows2k. I want to validate an XML doc, which has no schema reference, with an external schema which is on my PC. I am setting the following properties and...
4
by: Nicolas Mailhot | last post by:
Hi, I've been sent an xsd that uses the following construct : <xsi:element name="foo"> <xsi:complexType name="foo"> Is this something allowed ? I couldn't find anything that said it's...
2
by: Stanimir Stamenkov | last post by:
I'm trying to find out if it is permissible to include a schema document with absent target namespace to a schema with specified target namespace, and if it is, what are the rules to resolve the...
0
by: Harold Putman | last post by:
The XmlValidatingReader seems to have changed drastically in .Net Frameworks 1.0 SP3 and beyond with regards to validating XML files that are XML Schemas. Consider the following code: ---...
6
by: LesleyW | last post by:
Hi Apologies if this is a really dumb question, but being new to XML and Schemas, I wonder if giving the namespace for eg xsd or xsi as a website address means that the user has to be online...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
3
by: dantohester | last post by:
Hi there, I have the following situation: I want to create an XML document that contains 2 parts: a) a XHTML part (it can be either version 1.0 or 1.1 ) b) a non XHTML part that contains some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.