Hi NG!
In a XSD, we (try to) specify that a node ("BsqCallInfo") has two
attributes and can have any nodes as its children:
<xsd:element name="BsqCallInfo">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:any processContents="lax"/>
</xsd:choice>
<xsd:attribute name="Name" type="xsd:string" />
<xsd:attribute name="Description" type="xsd:string" />
</xsd:complexType>
</xsd:element>
Now we have the problem that different parsers handle it differently
and we do not have a clue, which one behaves correctly.
Some parsers claim that
<BsqCallInfo>
<SomeThing></SomeThing>
</BsqCallInfo>
is wrong because "SomeThing" is not part of the schema, others accept
it.
So, what is right, what is wrong?
Best regards,
Michael 5 1781 mk******@gmail.com wrote: In a XSD, we (try to) specify that a node ("BsqCallInfo") has two attributes and can have any nodes as its children:
<xsd:element name="BsqCallInfo"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:any processContents="lax"/> </xsd:choice> <xsd:attribute name="Name" type="xsd:string" /> <xsd:attribute name="Description" type="xsd:string" /> </xsd:complexType> </xsd:element>
Now we have the problem that different parsers handle it differently and we do not have a clue, which one behaves correctly.
Some parsers claim that
<BsqCallInfo> <SomeThing></SomeThing> </BsqCallInfo>
is wrong because "SomeThing" is not part of the schema, others accept it.
Which parsers have you tried, which say the snippet is valid, which say
it is not?
--
Martin Honnen http://JavaScript.FAQTs.com/
Hi,
It is valid for SomeThing to appear there, even if it is not declared.
When you specify processContents="lax", it means that it looks for
declarations for the elements like SomeThing but if it doesn't find them
it doesn't raise an error. (If it does find them it validates them.)
So, the parsers should be accepting that document. What parser does not
accept it?
Hope that helps,
Priscilla
----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema http://www.datypic.com
----------------------------------
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Hi Priscilla,
Thanks for your answer!
Priscilla Walmsley schrieb: It is valid for SomeThing to appear there, even if it is not declared.
When you specify processContents="lax", it means that it looks for declarations for the elements like SomeThing but if it doesn't find them it doesn't raise an error. (If it does find them it validates them.)
That's exactly how I interpreted the documentation!
So, the parsers should be accepting that document. What parser does not accept it?
MS XML 4 has accepted it, but the .net FX classes behave differently.
Here is an example what .net 2.0.41115 "thinks": http://www.mkcs.at/temp/pub/w2k3%5Fv...alidator%2Ejpg
A colleague found a Java XSD validator in the Internet, which says the
XML is correct. So we were confused that "older" parsers accepted it,
but "newer" one (at least, those from Microsoft) say there is an error.
I'll post this as a bug, because also VS.net 2005 Beta 2 thinks the XML
is not valid though it is as we know now.
Hope that helps,
Yes, it did. :-)
Priscilla
Thanks again and best regards,
Michael
-- http://www.mkcs.at/
The specified e-mail-address is valid and will be read.
Hi Martin,
Thanks for your reply! Which parsers have you tried, which say the snippet is valid, which say it is not?
Please see the answer to Priscilla's Posting.
Best regards,
Michael
-- http://www.mkcs.at/
The specified e-mail-address is valid and will be read.
Hi Michael,
VS 2005 Beta 2 does not exist yet. So I'm not sure which version you are
using - must be beta 1. Anyway, I just tried it with the build I have on my
machine and your XML validates just fine. So even if there is a problem
with earlier versions of VS 2005, it looks like it's should be fixed in
beta2.
--
Stan Kitsis
Program Manager, XML Technologies
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael Kremser" <mk************@yahoo.de> wrote in message
news:41********@e-post.inode.at... .................... I'll post this as a bug, because also VS.net 2005 Beta 2 thinks the XML is not valid though it is as we know now. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Yona |
last post by:
Im trying to validate an xml file using the xercesDomParser,
but it seems like it doesnt validate the xml file.
I get an error only if the schema isnt valid.
the code is:
DOMTreeErrorReporter...
|
by: MENTAT |
last post by:
Hi Guys,
Newbie question here. Part of my xml looks like this.
<node>
<description/>
<config/>
<log/>
<transition/>
<node>
|
by: Jon Poploskie |
last post by:
Hello,
I have an xsd file that I'm trying to use to validate some xml against. I'm
hoping this is a simple problem, but I just don't see it. I get the error
"The 'role' element is not...
|
by: Paw Pedersen |
last post by:
Is it possible to load a XSD and loop throw the nodes and attributes that
you whant filled out, and then generate a XML instance with the trees and
data that you have filled data in?
And how do...
|
by: Shailendra Batham |
last post by:
hi guys
I need your suggestions / opinion for doing this the right way.
I have a XML and a Schema for the same
What I want is when its validated against the schema, it should give custom...
|
by: Mark Jerde |
last post by:
We have developed about 80 XML documents, each probably 150 lines long, that
are all supposed to conform to a schema. My understanding is the way to
show that an XML document conforms to a schema...
|
by: christian.eickhoff |
last post by:
Hi Everyone,
I am currently implementing an XercesDOMParser to parse an XML file and
to validate this file against its XSD Schema file which are both
located on my local HD drive. For this...
|
by: Simon Brooke |
last post by:
The DOM API has included public Node importNode(Node,boolean) as a method
of the Document interface for a long time. Does anything actually
implement it? Xerces 2 is giving me:
...
|
by: Boris Kolpackov |
last post by:
Hi,
I am pleased to announce the availability of CodeSynthesis XSD 3.2.0.
CodeSynthesis XSD is an open-source (GPL2 + proprietary license), cross-
platform W3C XML Schema to C++ data binding...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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...
|
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...
|
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,...
| |