You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Vladimir Shtrakov <vl...@bioteam.com> on 2002/07/19 14:16:27 UTC

String restriction with pattern - Xerces_C

Hello,

I have the following problem:

Here is a fragment of my schema:

<xs:complexType name="EnumMailAttributeType">
  <xs:sequence>
   <xs:element name="Value" maxOccurs="unbounded">
    <xs:simpleType>
     <xs:restriction base="xs:string">
        <xs:pattern value="[-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&amp;_.;\[\]:]+"/>
   </xs:element>
  </xs:sequence>
  <xs:attribute name="name" use="required">
   <xs:simpleType>
    <xs:restriction base="xs:string">
        <xs:pattern value="[-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&amp;_.;\[\]:]+"/>
    </xs:restriction>
   </xs:simpleType>
  </xs:attribute>
  <xs:attribute name="hasNull" type="xs:boolean" use="optional" default="false"/>
 </xs:complexType>


And here is the xml document that I try to validate with Xerces_C and I've got errors:

<?xml version="1.0" encoding="UTF-8"?>
<EnumMailAttributeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MailAttributes.xsd">
 <Containers name="Cont">
  <Value>Cont1</Value>
  <Value>Cont2</Value>
  <Value>Cont3</Value>
 </Containers>
</EnumMailAttributeSet>

Error: Type of attribute 'name' must be validly derived from type of attribute in base.

Kind regards,
Vladimir Shtrakov

Re: String restriction with pattern - Xerces_C

Posted by Gareth Reakes <ga...@decisionsoft.com>.
Hi,
	your schema fragment is not well formed. 

Gareth

On Fri, 19 Jul 2002, Vladimir Shtrakov wrote:

> Hello,
> 
> I have the following problem:
> 
> Here is a fragment of my schema:
> 
> <xs:complexType name="EnumMailAttributeType">
>   <xs:sequence>
>    <xs:element name="Value" maxOccurs="unbounded">
>     <xs:simpleType>
>      <xs:restriction base="xs:string">
>         <xs:pattern value="[-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&amp;_.;\[\]:]+"/>

	need </xs:restriction>

>    </xs:element>

	need </xs:simpleType>

>   </xs:sequence>
>   <xs:attribute name="name" use="required">
>    <xs:simpleType>
>     <xs:restriction base="xs:string">
>         <xs:pattern value="[-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890&amp;_.;\[\]:]+"/>
>     </xs:restriction>
>    </xs:simpleType>
>   </xs:attribute>
>   <xs:attribute name="hasNull" type="xs:boolean" use="optional" default="false"/>
>  </xs:complexType>
> 
> 
> And here is the xml document that I try to validate with Xerces_C and I've got errors:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <EnumMailAttributeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="MailAttributes.xsd">
>  <Containers name="Cont">
>   <Value>Cont1</Value>
>   <Value>Cont2</Value>
>   <Value>Cont3</Value>
>  </Containers>
> </EnumMailAttributeSet>
> 
> Error: Type of attribute 'name' must be validly derived from type of attribute in base.
> 
> Kind regards,
> Vladimir Shtrakov
> 

-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org