DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6197>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6197

errors violating patterns aren't detected





------- Additional Comments From [EMAIL PROTECTED]  2002-02-04 17:04 -------
Hi,
We were simply trying to constrain an ISBN value.  Even the following did not 
work, and we did have the appropriate features set and were using SAX.

        <xsd:simpleType name="ISBNType">
                <xsd:restriction base="xsd:string">
                        <xsd:pattern value="[0-9]{10}"/>
                </xsd:restriction>
        </xsd:simpleType>

We tried all sorts of patterns and it doesn't seem to check violations of any 
of them.  Even a pattern of [A-Z} was passed, etc.

Here is a sample xml in which all the isbn's passed:
        <storeName>Jon's Books</storeName>
        <bookList>
                <entry softCover="true">
                        <title>T1</title>
                        <author>Jon Oliver</author>
                        <publishInfo>
                                <publisher>jack</publisher>
                                <datePublished>2002-01-01</datePublished>
                        </publishInfo>
                        <cost>23</cost>
                        <numPage>1233</numPage>
                        <numStock>1</numStock>
                        <ISBN>1-1-1-1-2222jasdlfjkljf/t22-1</ISBN>
                        <comment>This one rocks</comment>
                        <comment>A lot!</comment>
                </entry>
                <entry softCover="true">
                        <title>T2</title>
                        <author>George</author>
                        <publishInfo>
                                <publisher>Jack Smith</publisher>
                                <datePublished>2002-02-02</datePublished>
                        </publishInfo>
                        <cost>0</cost>
                        <numPage>5</numPage>
                        <numStock>10</numStock>
                        <ISBN></ISBN>
                        <comment></comment>
                </entry>
                <entry softCover="true">
                        <title>T3</title>
                        <author>Jonathan</author>
                        <author>Lisa</author>
                        <author>Willow</author>
                        <author>Jeremy</author>
                        <publishInfo>
                                <publisher>everyone</publisher>
                                <datePublished>1202-11-11</datePublished>
                        </publishInfo>
                        <cost>10</cost>
                        <numPage>1999</numPage>
                        <numStock>1</numStock>
                        <ISBN>1-5-124234244332434465454-6</ISBN>
                        <comment>This one has a really long ISBN</comment>
                </entry>

Here is the complete schema (without namespaces):
        <xsd:complexType name="publishType">
                <xsd:sequence>
                        <xsd:element name="publisher" type="xsd:string"/>
                        <xsd:element name="datePublished" type="xsd:date" 
                                minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:simpleType name="ISBNType">
                <xsd:restriction base="xsd:string">
                        <xsd:pattern value="[A-Z]"/>
                </xsd:restriction>
        </xsd:simpleType>


        <xsd:complexType name="entryType">
                <xsd:sequence>
                        <xsd:element name="title" type="xsd:string"/>
                        <xsd:element name="author" type="xsd:string"
                                maxOccurs="unbounded"/>
                        <xsd:element name="publishInfo" type="publishType"/>
                        <xsd:element name="cost" type="xsd:decimal"/>
                        <xsd:element name="numPage" 
type="xsd:nonNegativeInteger"
                                minOccurs="0"/>
                        <xsd:element name="numStock" type="xsd:integer"/>
                        <xsd:element name="ISBN" type="ISBNType"/>
                        <xsd:element name="comment" type="xsd:string"
                                minOccurs="0" maxOccurs="unbounded"/>
                </xsd:sequence>
                <xsd:attribute name="softCover" type="xsd:boolean" 
default="true"/>
        </xsd:complexType>

        <xsd:complexType name="bookListType">
                <xsd:sequence>
                        <xsd:element name="entry" type="entryType"
                                maxOccurs="unbounded" minOccurs="0"/>
                </xsd:sequence>
        </xsd:complexType>

        <xsd:element name="inventory">
                <xsd:complexType>
                        <xsd:sequence>
                                <xsd:element name="storeName" 
type="xsd:string"/>
                                <xsd:element name="bookList" 
type="bookListType" 
                                        minOccurs="0"/>
                        </xsd:sequence>
                </xsd:complexType>
        </xsd:element>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to