XML Service feed validation breaks on extra attribute against schema

rOnka

New Member
Given a task of working on supporting an old existing XML feed. The new request is adding a new attribute to the XML feed. When I add the new attribute "CountryOfOrigin" to the XML and then to the schema, validation fails. Now if I remove the new attribute from the XML and schema it works just fine. Here is the new XML with the new attribute and below it the schemaXML\[code\]<TagOrder><Tag><Message>1</Message><TagType>R</TagType><ItemNumber>190</ItemNumber><ItemXRef>E039</ItemXRef><VendorXRef>E39H</VendorXRef><Lvl02Desc>NEAR</Lvl02Desc><Lvl03Desc>NUG</Lvl03Desc><Lvl04Desc>EARRING</Lvl04Desc><Lvl05Desc>14KT</Lvl05Desc><Lvl06Desc></Lvl06Desc><VendorShortName>TEST</VendorShortName><SRP>1325.00</SRP><RetailPrice>1325.00</RetailPrice><CountryOfOrigin>TEST</CountryOfOrigin></Tag></TagOrder>\[/code\]Schema\[code\]<schema id="Data2-Tag" xmlns="http://www.w3.org/2001/XMLSchema">`<element name="Transaction"> <complexType> <sequence> <element name="TransactionId" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="long"> </restriction> </simpleType> </element> <element name="ClientId" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="long"> </restriction> </simpleType> </element> <element name="TagOrder" minOccurs="1" maxOccurs="unbounded"> <complexType> <sequence> <element name="Tag" minOccurs="1" maxOccurs="unbounded"> <complexType> <sequence> <element name="Message" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="int"> <minExclusive value="http://stackoverflow.com/questions/14588649/0"/> </restriction> </simpleType> </element> <element name="TagType" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/1"/> </restriction> </simpleType> </element> <element name="ItemNumber" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/50"/> </restriction> </simpleType> </element> <element name="ItemXRef" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/20" /> </restriction> </simpleType> </element> <element name="VendorXRef" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/20" /> </restriction> </simpleType> </element> <element name="Lvl02Desc" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/4" /> </restriction> </simpleType> </element> <element name="Lvl03Desc" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/3" /> </restriction> </simpleType> </element> <element name="Lvl04Desc" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/9" /> </restriction> </simpleType> </element> <element name="Lvl05Desc" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/8" /> </restriction> </simpleType> </element> <element name="Lvl06Desc" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/3" /> </restriction> </simpleType> </element> <element name="Lab" minOccurs="0" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/20"></maxLength> <enumeration value="http://stackoverflow.com/questions/14588649/Cultured"/> <enumeration value="http://stackoverflow.com/questions/14588649/Lab Created"/> </restriction> </simpleType> </element> <element name="VendorShortName" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/3"/> </restriction> </simpleType> </element> <element name="SRP" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="decimal"> <minInclusive value="http://stackoverflow.com/questions/14588649/0" /> <fractionDigits value="http://stackoverflow.com/questions/14588649/2"/> </restriction> </simpleType> </element> <element name="RetailPrice" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="decimal"> <minInclusive value="http://stackoverflow.com/questions/14588649/0" /> <fractionDigits value="http://stackoverflow.com/questions/14588649/2"/> </restriction> </simpleType> </element> <element name="CountryOfOrigin" minOccurs="1" maxOccurs="1"> <simpleType> <restriction base="string"> <maxLength value="http://stackoverflow.com/questions/14588649/100"/> </restriction> </simpleType> </element> </sequence> </complexType> </element> </sequence> </complexType> </element> </sequence> </complexType></element>\[/code\]If I remove "CountryOfOrigin" from both it works just fine and validates. Anyone see why the XML wouldn't validate against the schema?thanks^.^
 
Back
Top