« Return to Thread: Question on XML Schema with NetBeans 6.0

Re: Question on XML Schema with NetBeans 6.0

by Arshad Noor :: Rate this Message:

Reply to Author | View in Thread

Here is a simplified XSD that returns the same error:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 
targetNamespace="http://xml.netbeans.org/schema/NetbeansProblem"
             xmlns:tns="http://xml.netbeans.org/schema/NetbeansProblem"
             elementFormDefault="qualified">


     <!--
     =============================================
     SymkeyType
     =============================================
     -->
     <xsd:complexType name="SymkeyType">
         <xsd:annotation>
             <xsd:documentation>
                 A symmetric key object, which is the succesfully
                response of a request for a key from an SKMS client
                to an SKS server.
             </xsd:documentation>
         </xsd:annotation>
         <xsd:sequence>
             <xsd:element name="GlobalKeyID">
                  <xsd:simpleType>
                     <xsd:restriction base="xsd:string">
                         <xsd:maxLength value="32"/>
                         <xsd:whiteSpace value="preserve"/>
                     </xsd:restriction>
                 </xsd:simpleType>
             </xsd:element>
         </xsd:sequence>
     </xsd:complexType>

     <!--
     =============================================
     SymkeyErrorType
     =============================================
     -->
     <xsd:complexType name="SymkeyErrorType">
         <xsd:annotation>
             <xsd:documentation>
                 A response with an error message in the event that
                a request was not successful.
             </xsd:documentation>
         </xsd:annotation>
         <xsd:sequence>
             <xsd:element name="RequestedGlobalKeyID">
                  <xsd:simpleType>
                     <xsd:restriction base="xsd:string">
                         <xsd:maxLength value="32"/>
                         <xsd:whiteSpace value="preserve"/>
                     </xsd:restriction>
                 </xsd:simpleType>
             </xsd:element>
         </xsd:sequence>
     </xsd:complexType>

     <!--
     =============================================
     SymkeyResponse
     =============================================
     -->

     <xsd:element name="SymkeyResponse">
         <xsd:complexType>
             <xsd:choice>
                 <xsd:element ref="tns:Symkey" minOccurs="1"
maxOccurs="unbounded"/>
                 <xsd:element ref="tns:SymkeyError" minOccurs="1"
maxOccurs="unbounded"/>
                 <xsd:group ref="tns:SymkeyWithSymkeyErrorGroup"/>
             </xsd:choice>
         </xsd:complexType>
     </xsd:element>


     <xsd:element name="Symkey" type="tns:SymkeyType"></xsd:element>
     <xsd:element name="SymkeyError"
type="tns:SymkeyErrorType"></xsd:element>
     <xsd:group name="SymkeyWithSymkeyErrorGroup">
         <xsd:sequence>
             <xsd:element ref="tns:Symkey" minOccurs="1"
maxOccurs="unbounded"/>
             <xsd:element ref="tns:SymkeyError" minOccurs="1"
maxOccurs="unbounded"/>
         </xsd:sequence>
     </xsd:group>
</xsd:schema>

Thanks.

Arshad Noor
StrongAuth, Inc.

Samaresh wrote:

> Is it possible for you to send the schema?
>
> Arshad Noor wrote:
>> Hi,
>>
>> I have the following defined in an XSD:
>>
>>
>> <xsd:element name="Symkey" type="ekmi:SymkeyType"/>
>> <xsd:element name="SymkeyError" type="ekmi:SymkeyErrorType"/>
>>
>> <xsd:group name="SymkeyWithSymkeyErrorGroup">
>>     <xsd:sequence>
>>        <xsd:element ref="ekmi:Symkey"/>
>>        <xsd:element ref="ekmi:SymkeyError"/>
>>     </xsd:sequence>
>> </xsd:group>
>>
>>
>> I'm trying to define a complex type that has a choice
>> of either the Symkey or the SymkeyError elements, or
>> the above-defined group which includes both elements.
>>
>> However, NB 6.0 keeps giving me the error:
>>
>> Error: cos-nonambig: "http://docs.oasis-open.org/ekmi/2008/01":Symkey
>> and "http://docs.oasis-open.org/ekmi/2008/01":Symkey (or elements from
>> their substitution group) violate "Unique Particle Attribution". During
>> validation against this schema, ambiguity would be created for those two
>> particles.
>>
>> Since I can only have a Symkey, SymkeyError or a combination
>> of both in the to-be-defined element, why does NB think there
>> will be ambiguity?  How do I go about accomplishing what I
>> want?  Thanks in advance.
>>
>> Arshad Noor
>>
>>
>

 « Return to Thread: Question on XML Schema with NetBeans 6.0