You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Ron Rothblum <RO...@il.ibm.com> on 2003/06/10 14:00:50 UTC

Re: Bug with patterns?

here are the files as plain text:


The XML:


<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Mira BarShay
(IBM Israel S&T) -->
<amt xmlns="http://www.ibm.com/amt/" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.ibm.com/amt/ simple.xsd">
  <node attr="hello">
     <subNode name="ree"/>
  </node>
  <node attr="as">
     <subNode name="5"/>
  </node>
</amt>

The XSD:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Mira BarShay
(IBM Israel S&T) -->
<xs:schema targetNamespace="http://www.ibm.com/amt/" xmlns:amt="
http://www.ibm.com/amt/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="amt">
     <xs:complexType>
       <xs:sequence>
          <xs:element name="node" minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
               <xs:sequence>
                 <xs:element name="subNode" minOccurs="0" maxOccurs="
unbounded">
                    <xs:complexType>
                      <xs:attribute name="name" use="required">
                         <xs:simpleType>
                           <xs:restriction base="xs:string">
                              <xs:pattern value="[a-z,A-Z]([0-9,a-z,A-Z]|_)
*"/>
                           </xs:restriction>
                         </xs:simpleType>
                      </xs:attribute>
                    </xs:complexType>
                 </xs:element>
               </xs:sequence>
               <xs:attribute name="attr" use="required">
                 <xs:simpleType>
                    <xs:restriction base="xs:string">
                      <xs:pattern value="[a-z,A-Z]([0-9,a-z,A-Z]|_)*"/>
                    </xs:restriction>
                 </xs:simpleType>
               </xs:attribute>
            </xs:complexType>
            <xs:key name="subName">
               <xs:selector xpath="amt:subNode"/>
               <xs:field xpath="@name"/>
            </xs:key>
          </xs:element>
       </xs:sequence>
     </xs:complexType>
  </xs:element>
</xs:schema>

Ron Rothblum
Active Technologies Department
IBM Haifa Research Labs
Phone:   +972 4 829-6459


|---------+---------------------------->
|         |           Ron              |
|         |           Rothblum/Haifa/IB|
|         |           M@IBMIL          |
|         |                            |
|         |           10/06/2003 14:35 |
|         |           Please respond to|
|         |           xerces-j-user    |
|---------+---------------------------->
  >--------------------------------------------------------------------------------------------------------------|
  |                                                                                                              |
  |       To:       xerces-j-user@xml.apache.org                                                                 |
  |       cc:                                                                                                    |
  |       Subject:  Re: Bug with patterns?                                                                       |
  >--------------------------------------------------------------------------------------------------------------|




Sorry it took so long to reply - It was very difficult to make a sample
that recreates the problem.
It seems like the problem occurs when there is a key on an attribute of a
level 2 nested node (as can be seen in the sample).

(See attached file: simple.xsd) (See attached file: bug.xml)

Ron Rothblum
Active Technologies Department
 IBM Haifa Research Labs
Phone:   +972 4 829-6459


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

#### simple.xsd has been removed from this note on June 10, 2003 by Ron
Rothblum
#### bug.xml has been removed from this note on June 10, 2003 by Ron
Rothblum



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