Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - XML schema question >Thread Next - Re: XML schema question Re: XML schema questionTo: NULL Date: 4/5/2006 10:48:00 AM hi, you cannot have two elements with the same name in the same scope that differ only in attributes. Reason: A content model must be formed such that during validation of an element, the items inside it can be uniqhely determined without examining the content or attributes of that item. hope this helps, swapna "John Smith" <john.smith@m...> wrote in message news:z1LYf.1475$oj5.582887@n...... > > I have created a schema, but I got an error validating it. Is it possible to > have 2 ds:Reference elements (with different attributes)? > > Error message: > > Element "ds:Reference" occurs more than once in the same content model but > does not refer to top-level type definition. > > Schema: > > <schema xmlns="http://www.w3.org/2001/XMLSchema" > xmlns:ds="http://www.w3.org/2000/09/xmldsig#" > targetNamespace="http://www.w3.org/2000/09/xmldsig#" > elementFormDefault="qualified" version="0.1"> > <!-- Basic Types Defined for Signatures --> > <simpleType name="CryptoBinary"> > <restriction base="base64Binary"/> > </simpleType> > <!-- Start Signature --> > <element name="Signature" type="ds:SignatureType"/> > <complexType name="SignatureType"> > <sequence> > <element ref="ds:SignedInfo"/> > <element ref="ds:SignatureValue"/> > <element ref="ds:KeyInfo"/> > </sequence> > <attribute name="Id" type="string" use="required" fixed="sig1"/> > </complexType> > <element name="SignatureValue" type="ds:SignatureValueType"/> > <complexType name="SignatureValueType"> > <simpleContent> > <extension base="base64Binary"> > <attribute name="Id" type="ID" use="optional"/> > </extension> > </simpleContent> > </complexType> > <!-- Start SignedInfo --> > <element name="SignedInfo" type="ds:SignedInfoType"/> > <complexType name="SignedInfoType"> > <sequence> > <element ref="ds:CanonicalizationMethod"/> > <element ref="ds:SignatureMethod"/> > <element name="Reference"> > <complexType> > <sequence> > <element ref="ds:DigestMethod"/> > <element ref="ds:DigestValue"/> > </sequence> > <attribute name="URI" type="anyURI" use="required" fixed="#data1"/> > </complexType> > </element> > <element name="Reference"> > <complexType> > <sequence> > <element ref="ds:DigestMethod"/> > <element ref="ds:DigestValue"/> > </sequence> > <attribute name="URI" type="anyURI" use="required" fixed="#tra1"/> > </complexType> > </element> > </sequence> > <attribute name="Id" type="ID" use="optional"/> > </complexType> > <element name="CanonicalizationMethod" > type="ds:CanonicalizationMethodType"/> > <complexType name="CanonicalizationMethodType" mixed="true"> > <attribute name="Algorithm" type="anyURI" use="required"/> > </complexType> > <element name="SignatureMethod" type="ds:SignatureMethodType"/> > <complexType name="SignatureMethodType" mixed="true"> > <attribute name="Algorithm" type="anyURI" use="required"/> > </complexType> > <element name="DigestMethod" type="ds:DigestMethodType"/> > <complexType name="DigestMethodType" mixed="true"> > <attribute name="Algorithm" type="anyURI" use="required"/> > </complexType> > <element name="DigestValue" type="ds:DigestValueType"/> > <simpleType name="DigestValueType"> > <restriction base="base64Binary"/> > </simpleType> > <!-- End SignedInfo --> > <!-- Start KeyInfo --> > <element name="KeyInfo" type="ds:KeyInfoType"/> > <complexType name="KeyInfoType" mixed="true"> > <choice> > <element ref="ds:X509Data"/> > </choice> > <attribute name="Id" type="ID" use="optional"/> > </complexType> > <!-- Start X509Data --> > <element name="X509Data" type="ds:X509DataType"/> > <complexType name="X509DataType"> > <sequence> > <choice> > <element name="X509Certificate" type="base64Binary"/> > </choice> > </sequence> > </complexType> > <!-- End X509Data --> > <!-- End KeyInfo --> > <!-- End Signature --> > </schema> > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
