[xml] xmlSchemaParse() generate error



I am using this XML parser for parsing and validating CPL(Call Processing Language).
When I tried to parse XML Schema definition for CPL using xmlSchemaParse(), I found that XML parser alway returns error.
I don't want to believe that the author of CPL draft makes error while editing XML schema for CPL.
 
This is CPL Schema chunk where xmlSchemaParse() returns error.

     <xs:complexType name="StringType">
       <xs:group ref="Node"/>
       <xs:attribute name="is" type="xs:string" use="optional"/>
       <xs:attribute name="contains" type="xs:string" use="optional"/>
       <xs:anyAttribute namespace="##any" processContents="lax"/> 
     </xs:complexType>
     <xs:complexType name="StringSwitchType">
       <xs:complexContent>
         <xs:extension base="SwitchType">
           <xs:sequence>
             <xs:element name="string" type="StringType" minOccurs="0"
                 maxOccurs="unbounded"/>
             <xs:sequence minOccurs="0">                                                    
               <xs:element name="not-present" type="NotPresentAction"/>
               <xs:element name="string" type="StringType" minOccurs="0"
                   maxOccurs="unbounded"/>
             </xs:sequence>
             <xs:element name="otherwise" type="OtherwiseAction"
                 minOccurs="0"/>
           </xs:sequence>
           <xs:attribute name="field" type="StringFieldType"
               use="required">
             <xs:annotation>
               <xs:documentation>Strings are matched as case-insensitive
                   Unicode strings.</xs:documentation>
             </xs:annotation>
           </xs:attribute>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
     <xs:element name="string-switch" type="StringSwitchType"
         substitutionGroup="switch"/>
 
in above xml schema chunk, xmlSchemaParse()'s error message is something like
"Conent model of string-switch is not deterministic".
So, I try to parse again after modifing this code chunk to....
 
--- modified xml schema chunk ----
    <xs:complexType name="StringType">
       <xs:group ref="Node"/>
       <xs:attribute name="is" type="xs:string" use="optional"/>
       <xs:attribute name="contains" type="xs:string" use="optional"/>
       <xs:anyAttribute namespace="##any" processContents="lax"/>
     </xs:complexType>
     <xs:complexType name="StringSwitchType">
       <xs:complexContent>
         <xs:extension base="SwitchType">
           <xs:sequence>
             <xs:element name="string" type="StringType" minOccurs="0"
                 maxOccurs="unbounded"/>
             <xs:element name="not-present" type="NotPresentAction" minOccurs="0"/>
             <xs:element name="otherwise" type="OtherwiseAction"
                 minOccurs="0"/>
           </xs:sequence>
           <xs:attribute name="field" type="StringFieldType"
               use="required">
             <xs:annotation>
               <xs:documentation>Strings are matched as case-insensitive
                   Unicode strings.</xs:documentation>
             </xs:annotation>
           </xs:attribute>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>
     <xs:element name="string-switch" type="StringSwitchType"
         substitutionGroup="switch"/>
 
well, after modifing schema chunk, I got difference error message,
"attribute anyattribute 18 has nor type nor reference".
after deleting  <xs:anyAttribute namespace="##any" processContents="lax"/> line from XML source,
I can successfully parse XML schema for CPL.
Plz explain why such error occurs..
Thanks in advance.
 
 
 
 

 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]