schema validation HELP (converted from Biztalk 2004 to 2006 R2)
This schema used to work on our Biztalk 2004 environment but throws an error when compiled in Biztalk 2006 R2.
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Project.Schemas.External.ScheduleRepair" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="schedulerepair">
<xs:complexType>
<xs:complexContent mixed="true">
<xs:extension base="xs:anyType">
<xs:sequence>
<xs:element name="customerremarks">
<xs:complexType />
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>
now we get this error:
Error 54 Wildcard '##any' allows element 'customerremarks', and causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the seque开发者_运维百科nce in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence. C:\Project\ScheduleRepair.xsd
I don't see anything different about the mentioned node. Besides when i delete that node, it'll just go on to point out something else as the culprit. I know this had something to do with the .NET 1.1 to 2.0 change but we need to get this schema to work somehow.
PLEASE HELP!
Wow StackOverflow, where are your experts? 1 day, 12 views on the question and no attempt to a response!!!
I got help from a developer in the Philippines, they're definitely first class over there! Thanks Rose!
Here's her original message:
Hello,
Checking the schema from BizTalk 2004, I see that schedulerepair element is in xs:anyType with Derived By property set to Extension. As far as I recall, we cannot set the Derived By property to Extension to derive from an xs:anyType otherwise the error you stated below will be encountered. To correct this, we can either change the Derived By property to Restriction or change the Base Data Type property from xs:anyType to some other types and rebuild the schema.
The error you encountered is raised due to a new check which has been introduced in the 2.0 framework as part of the restructuring of the 2.0 XML libraries.
Couldn’t exactly determine if that really is the case here as I have no Biztalk 2006 R2 to compile to but anyway hope this helps.
Thanks! Rose
She didn't even have the newer Biztalk version to test it but her advice worked on my machine. Here's the new schema:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Project.Schemas.External.ScheduleRepair" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="schedulerepair">
<xs:complexType>
<xs:complexContent mixed="true">
<xs:restriction base="xs:anyType">
<xs:sequence>
<xs:element name="customerremarks">
<xs:complexType />
</xs:element>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:schema>
Amazing work Rose! Thanks again!
精彩评论