Hi,
Thanks for your quick response.
Sorry but I have some questions for you :-)
1. You wrote that ##any makes a conflict with FName. So, how can this:
<xsd:any namespace="##any" processContents="skip" />
come with additonal elements at all?
2. I succeeded to validate the above xsd:any with FName element in a
non-nested schema:
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="1">
<xsd:element name="FName" type="xsd:string" minOccurs="0"
maxOccurs="1" />
<xsd:any namespace="##any" processContents="skip" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Why in this case there is no ambiguousness?
3.How can I keep the original xsd structure and be able to validate
xml with an undefined elements?
Thanks a lot pal.
"Zafar Abbas [MSFT]" <za****@microsoft.com> wrote in message news:<#9**************@TK2MSFTNGP10.phx.gbl>...
Your schema is non deterministic since it violates UPA rules defined by the
W3C Xml Schema Spec[1]. The wildcard (##any) allows element 'Fname' as well
so at validation time it could not be determined which particle to validate
by.
[1] http://www.w3.org/TR/xmlschema-1/#cos-nonambig
You have to modify your schema to be un ambiguous in order to use it for
validation.
"yaya9" <ya*****@cellcom.co.il> wrote in message
news:67*************************@posting.google.co m... pls help me!
I have a nested xml:
<?xml version="1.0" encoding="utf-8" ?>
<root>
<myType>
<FName />
<pop />
</myType>
</root>
with this xsd:
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema id="test1" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="1">
<xsd:element name="myType" type="niceType" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="niceType">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="FName" type="xsd:string" minOccurs="0" maxOccurs="1" />
<xsd:any namespace="##any" processContents="skip" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
I'm getting an unhandled exception
anyone?