You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-dev@xml.apache.org by xm...@xml.apache.org on 2004/06/18 19:25:11 UTC

[jira] Created: (XMLBEANS-38) Does not support xs:key (keyRef NoIllegalEntries)

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-38

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-38
    Summary: Does not support xs:key (keyRef NoIllegalEntries)
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: XMLBeans
   Versions:
             Version 1

   Assignee: 
   Reporter: Drew Kurry

    Created: Fri, 18 Jun 2004 10:23 AM
    Updated: Fri, 18 Jun 2004 10:23 AM
Environment: Linux J2SEE 1.4.1_05

Description:
XMLBeans does not support the <xs:key name=""> feature used in XSD Schema.  I have tried multiple schemas using this feature and when I go to validate an XML document, I get the same error:

Key '<the-name-of-your-key' not found (keyRef NoIllegalEntries)

I am sure this is valid syntax as XML Spy and other editors are ok with the key ref tag as this is supported within XSD.  

I have included a sample XSD and XML document that includes these values.

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="supermarket">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="aisle" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
											<xsd:attribute name="quantity" type="xsd:positiveInteger"/>
											<xsd:attribute name="price" type="xsd:decimal"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
						
						<!-- Attribute Of Aisle -->
						<xsd:attribute name="name" type="xsd:string"/>
						<xsd:attribute name="number" type="xsd:positiveInteger"/>
					     <!-- Of Aisle -->
					
					</xsd:complexType>
					
					<xsd:keyref name="NoIllegalEntries" refer="itemKey">
						<xsd:selector xpath="item"/>
						<xsd:field xpath="@code"/>
					</xsd:keyref>
				</xsd:element>
				<xsd:element name="items">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
			<xsd:attribute name="name" type="xsd:string"/>
		</xsd:complexType>
		<xsd:key name="itemKey">
			<xsd:selector xpath="items/item"/>
			<xsd:field xpath="@code"/>
		</xsd:key>
	</xsd:element>
</xsd:schema>

***********************
and sample XML
***********************
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<supermarket xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\tmp\Supermarket.xsd" name="String">
	<aisle name="String" number="2">
		<item code="1234" quantity="2" price="3.1415926535897932384626433832795">String</item>
	</aisle>
	
	<items>
		<item code="1234">Java</item>
	</items>
</supermarket>





---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


[jira] Commented: (XMLBEANS-38) Does not support xs:key (keyRef NoIllegalEntries)

Posted by xm...@xml.apache.org.
The following comment has been added to this issue:

     Author: Jacob Danner
    Created: Wed, 29 Sep 2004 2:10 PM
       Body:
For regression test, add the following to drtcases.ValidationTests:

    /** Jira xmlbeans-38: Does not support xs:key (keyRef NoIllegalEntries) */
    public void testValidate12() throws Exception {
        String schemas[] = {
            "<?xml version=\"1.0\"?> \n" +
                "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\n" +
                "<xsd:element name=\"supermarket\">\n" +
                "<xsd:complexType>\n" +
                "<xsd:sequence>\n" +
                "<xsd:element name=\"aisle\" maxOccurs=\"unbounded\">\n" +
                "<xsd:complexType>\n" +
                "<xsd:sequence>\n" +
                "<xsd:element name=\"item\" maxOccurs=\"unbounded\">\n" +
                "<xsd:complexType>\n" +
                "<xsd:simpleContent>\n" +
                "<xsd:extension base=\"xsd:string\">\n" +
                "<xsd:attribute name=\"code\" type=\"xsd:positiveInteger\"/>\n" +
                "<xsd:attribute name=\"quantity\" type=\"xsd:positiveInteger\"/>\n" +
                "<xsd:attribute name=\"price\" type=\"xsd:decimal\"/>\n" +
                "</xsd:extension>\n" +
                "</xsd:simpleContent>\n" +
                "</xsd:complexType>\n" +
                "</xsd:element>\n" +
                "</xsd:sequence>\n" +
                "<!-- Attribute Of Aisle -->\n" +
                "<xsd:attribute name=\"name\" type=\"xsd:string\"/>\n" +
                "<xsd:attribute name=\"number\" type=\"xsd:positiveInteger\"/>\n" +
                "<!-- Of Aisle -->\n" +
                "</xsd:complexType>\n" +
                "<xsd:keyref name=\"NoIllegalEntries\" refer=\"itemKey\">\n" +
                "<xsd:selector xpath=\"item\"/>\n" +
                "<xsd:field xpath=\"@code\"/>\n" +
                "</xsd:keyref>\n" +
                "</xsd:element>\n" +
                "<xsd:element name=\"items\">\n" +
                "<xsd:complexType>\n" +
                "<xsd:sequence>\n" +
                "<xsd:element name=\"item\" maxOccurs=\"unbounded\">\n" +
                "<xsd:complexType>\n" +
                "<xsd:simpleContent>\n" +
                "<xsd:extension base=\"xsd:string\">\n" +
                "<xsd:attribute name=\"code\" type=\"xsd:positiveInteger\"/>\n" +
                "</xsd:extension>\n" +
                "</xsd:simpleContent>\n" +
                "</xsd:complexType>\n" +
                "</xsd:element>\n" +
                "</xsd:sequence>\n" +
                "</xsd:complexType>\n" +
                "</xsd:element>\n" +
                "</xsd:sequence>\n" +
                "<xsd:attribute name=\"name\" type=\"xsd:string\"/>\n" +
                "</xsd:complexType>\n" +
                "<xsd:key name=\"itemKey\">\n" +
                "<xsd:selector xpath=\"items/item\"/>\n" +
                "<xsd:field xpath=\"@code\"/>\n" +
                "</xsd:key>\n" +
                "</xsd:element>\n" +
                "</xsd:schema>",
        };

        String[] valid = {
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->\n" +
                "<supermarket xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
                "xsi:noNamespaceSchemaLocation=\"jira38.xsd\" name=\"String\">\n" +
                "<aisle name=\"String\" number=\"2\">\n" +
                "<item code=\"1234\" quantity=\"2\" price=\"3.1415926535897932384626433832795\">String</item>\n" +
                "</aisle> \n" +
                "<items>\n" +
                "<item code=\"1234\">Java</item>\n" +
                "</items>\n" +
                "</supermarket>",
        };

        String[] invalid = {
            "<enumDef>enum2/enumDef>",
        };

        doTest(schemas, null, valid, invalid);
    }
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XMLBEANS-38?page=comments#action_53518

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-38

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-38
    Summary: Does not support xs:key (keyRef NoIllegalEntries)
       Type: Bug

     Status: Open
   Priority: Major

    Project: XMLBeans
   Versions:
             Version 1

   Assignee: Dave Remy
   Reporter: Drew Kurry

    Created: Fri, 18 Jun 2004 10:23 AM
    Updated: Wed, 29 Sep 2004 2:10 PM
Environment: Linux J2SEE 1.4.1_05

Description:
XMLBeans does not support the <xs:key name=""> feature used in XSD Schema.  I have tried multiple schemas using this feature and when I go to validate an XML document, I get the same error:

Key '<the-name-of-your-key' not found (keyRef NoIllegalEntries)

I am sure this is valid syntax as XML Spy and other editors are ok with the key ref tag as this is supported within XSD.  

I have included a sample XSD and XML document that includes these values.

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="supermarket">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="aisle" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
											<xsd:attribute name="quantity" type="xsd:positiveInteger"/>
											<xsd:attribute name="price" type="xsd:decimal"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
						
						<!-- Attribute Of Aisle -->
						<xsd:attribute name="name" type="xsd:string"/>
						<xsd:attribute name="number" type="xsd:positiveInteger"/>
					     <!-- Of Aisle -->
					
					</xsd:complexType>
					
					<xsd:keyref name="NoIllegalEntries" refer="itemKey">
						<xsd:selector xpath="item"/>
						<xsd:field xpath="@code"/>
					</xsd:keyref>
				</xsd:element>
				<xsd:element name="items">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
			<xsd:attribute name="name" type="xsd:string"/>
		</xsd:complexType>
		<xsd:key name="itemKey">
			<xsd:selector xpath="items/item"/>
			<xsd:field xpath="@code"/>
		</xsd:key>
	</xsd:element>
</xsd:schema>

***********************
and sample XML
***********************
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<supermarket xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\tmp\Supermarket.xsd" name="String">
	<aisle name="String" number="2">
		<item code="1234" quantity="2" price="3.1415926535897932384626433832795">String</item>
	</aisle>
	
	<items>
		<item code="1234">Java</item>
	</items>
</supermarket>





---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (XMLBEANS-38) Does not support xs:key (keyRef NoIllegalEntries)

Posted by xm...@xml.apache.org.
The following issue has been updated:

    Updater: Jacob Danner (mailto:jacobd@bea.com)
       Date: Wed, 29 Sep 2004 3:35 PM
    Changes:
             Version changed to Version 2
             Version changed to Version 1.0.3
             Version changed to V2 Beta 1
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/XMLBEANS-38?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-38

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-38
    Summary: Does not support xs:key (keyRef NoIllegalEntries)
       Type: Bug

     Status: Open
   Priority: Major

    Project: XMLBeans
   Versions:
             Version 1
             Version 2
             Version 1.0.3
             V2 Beta 1

   Assignee: Dave Remy
   Reporter: Drew Kurry

    Created: Fri, 18 Jun 2004 10:23 AM
    Updated: Wed, 29 Sep 2004 3:35 PM
Environment: Linux J2SEE 1.4.1_05

Description:
XMLBeans does not support the <xs:key name=""> feature used in XSD Schema.  I have tried multiple schemas using this feature and when I go to validate an XML document, I get the same error:

Key '<the-name-of-your-key' not found (keyRef NoIllegalEntries)

I am sure this is valid syntax as XML Spy and other editors are ok with the key ref tag as this is supported within XSD.  

I have included a sample XSD and XML document that includes these values.

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="supermarket">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="aisle" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
											<xsd:attribute name="quantity" type="xsd:positiveInteger"/>
											<xsd:attribute name="price" type="xsd:decimal"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
						
						<!-- Attribute Of Aisle -->
						<xsd:attribute name="name" type="xsd:string"/>
						<xsd:attribute name="number" type="xsd:positiveInteger"/>
					     <!-- Of Aisle -->
					
					</xsd:complexType>
					
					<xsd:keyref name="NoIllegalEntries" refer="itemKey">
						<xsd:selector xpath="item"/>
						<xsd:field xpath="@code"/>
					</xsd:keyref>
				</xsd:element>
				<xsd:element name="items">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
			<xsd:attribute name="name" type="xsd:string"/>
		</xsd:complexType>
		<xsd:key name="itemKey">
			<xsd:selector xpath="items/item"/>
			<xsd:field xpath="@code"/>
		</xsd:key>
	</xsd:element>
</xsd:schema>

***********************
and sample XML
***********************
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<supermarket xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\tmp\Supermarket.xsd" name="String">
	<aisle name="String" number="2">
		<item code="1234" quantity="2" price="3.1415926535897932384626433832795">String</item>
	</aisle>
	
	<items>
		<item code="1234">Java</item>
	</items>
</supermarket>





---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Closed: (XMLBEANS-38) Does not support xs:key (keyRef NoIllegalEntries)

Posted by "Jacob Danner (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-38?page=all ]
     
Jacob Danner closed XMLBEANS-38:
--------------------------------

    Assign To:     (was: Radu Preotiuc-Pietro)

Radu's right, test case update and error code validation contribution pending

> Does not support xs:key (keyRef NoIllegalEntries)
> -------------------------------------------------
>
>          Key: XMLBEANS-38
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-38
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 1, Version 2, Version 1.0.3, Version 2 Beta 1
>  Environment: Linux J2SEE 1.4.1_05
>     Reporter: Drew Kurry
>      Fix For: unspecified

>
> XMLBeans does not support the <xs:key name=""> feature used in XSD Schema.  I have tried multiple schemas using this feature and when I go to validate an XML document, I get the same error:
> Key '<the-name-of-your-key' not found (keyRef NoIllegalEntries)
> I am sure this is valid syntax as XML Spy and other editors are ok with the key ref tag as this is supported within XSD.  
> I have included a sample XSD and XML document that includes these values.
> <?xml version="1.0"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:element name="supermarket">
> 		<xsd:complexType>
> 			<xsd:sequence>
> 				<xsd:element name="aisle" maxOccurs="unbounded">
> 					<xsd:complexType>
> 						<xsd:sequence>
> 							<xsd:element name="item" maxOccurs="unbounded">
> 								<xsd:complexType>
> 									<xsd:simpleContent>
> 										<xsd:extension base="xsd:string">
> 											<xsd:attribute name="code" type="xsd:positiveInteger"/>
> 											<xsd:attribute name="quantity" type="xsd:positiveInteger"/>
> 											<xsd:attribute name="price" type="xsd:decimal"/>
> 										</xsd:extension>
> 									</xsd:simpleContent>
> 								</xsd:complexType>
> 							</xsd:element>
> 						</xsd:sequence>
> 						
> 						<!-- Attribute Of Aisle -->
> 						<xsd:attribute name="name" type="xsd:string"/>
> 						<xsd:attribute name="number" type="xsd:positiveInteger"/>
> 					     <!-- Of Aisle -->
> 					
> 					</xsd:complexType>
> 					
> 					<xsd:keyref name="NoIllegalEntries" refer="itemKey">
> 						<xsd:selector xpath="item"/>
> 						<xsd:field xpath="@code"/>
> 					</xsd:keyref>
> 				</xsd:element>
> 				<xsd:element name="items">
> 					<xsd:complexType>
> 						<xsd:sequence>
> 							<xsd:element name="item" maxOccurs="unbounded">
> 								<xsd:complexType>
> 									<xsd:simpleContent>
> 										<xsd:extension base="xsd:string">
> 											<xsd:attribute name="code" type="xsd:positiveInteger"/>
> 										</xsd:extension>
> 									</xsd:simpleContent>
> 								</xsd:complexType>
> 							</xsd:element>
> 						</xsd:sequence>
> 					</xsd:complexType>
> 				</xsd:element>
> 			</xsd:sequence>
> 			<xsd:attribute name="name" type="xsd:string"/>
> 		</xsd:complexType>
> 		<xsd:key name="itemKey">
> 			<xsd:selector xpath="items/item"/>
> 			<xsd:field xpath="@code"/>
> 		</xsd:key>
> 	</xsd:element>
> </xsd:schema>
> ***********************
> and sample XML
> ***********************
> <?xml version="1.0" encoding="UTF-8"?>
> <!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
> <supermarket xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\tmp\Supermarket.xsd" name="String">
> 	<aisle name="String" number="2">
> 		<item code="1234" quantity="2" price="3.1415926535897932384626433832795">String</item>
> 	</aisle>
> 	
> 	<items>
> 		<item code="1234">Java</item>
> 	</items>
> </supermarket>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (XMLBEANS-38) Does not support xs:key (keyRef NoIllegalEntries)

Posted by "Jacob Danner (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-38?page=history ]

Jacob Danner reassigned XMLBEANS-38:
------------------------------------

    Assign To: Radu Preotiuc-Pietro  (was: Jacob Danner)

This issue still occurs.

> Does not support xs:key (keyRef NoIllegalEntries)
> -------------------------------------------------
>
>          Key: XMLBEANS-38
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-38
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 1, Version 2, Version 1.0.3, Version 2 Beta 1
>  Environment: Linux J2SEE 1.4.1_05
>     Reporter: Drew Kurry
>     Assignee: Radu Preotiuc-Pietro

>
> XMLBeans does not support the <xs:key name=""> feature used in XSD Schema.  I have tried multiple schemas using this feature and when I go to validate an XML document, I get the same error:
> Key '<the-name-of-your-key' not found (keyRef NoIllegalEntries)
> I am sure this is valid syntax as XML Spy and other editors are ok with the key ref tag as this is supported within XSD.  
> I have included a sample XSD and XML document that includes these values.
> <?xml version="1.0"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:element name="supermarket">
> 		<xsd:complexType>
> 			<xsd:sequence>
> 				<xsd:element name="aisle" maxOccurs="unbounded">
> 					<xsd:complexType>
> 						<xsd:sequence>
> 							<xsd:element name="item" maxOccurs="unbounded">
> 								<xsd:complexType>
> 									<xsd:simpleContent>
> 										<xsd:extension base="xsd:string">
> 											<xsd:attribute name="code" type="xsd:positiveInteger"/>
> 											<xsd:attribute name="quantity" type="xsd:positiveInteger"/>
> 											<xsd:attribute name="price" type="xsd:decimal"/>
> 										</xsd:extension>
> 									</xsd:simpleContent>
> 								</xsd:complexType>
> 							</xsd:element>
> 						</xsd:sequence>
> 						
> 						<!-- Attribute Of Aisle -->
> 						<xsd:attribute name="name" type="xsd:string"/>
> 						<xsd:attribute name="number" type="xsd:positiveInteger"/>
> 					     <!-- Of Aisle -->
> 					
> 					</xsd:complexType>
> 					
> 					<xsd:keyref name="NoIllegalEntries" refer="itemKey">
> 						<xsd:selector xpath="item"/>
> 						<xsd:field xpath="@code"/>
> 					</xsd:keyref>
> 				</xsd:element>
> 				<xsd:element name="items">
> 					<xsd:complexType>
> 						<xsd:sequence>
> 							<xsd:element name="item" maxOccurs="unbounded">
> 								<xsd:complexType>
> 									<xsd:simpleContent>
> 										<xsd:extension base="xsd:string">
> 											<xsd:attribute name="code" type="xsd:positiveInteger"/>
> 										</xsd:extension>
> 									</xsd:simpleContent>
> 								</xsd:complexType>
> 							</xsd:element>
> 						</xsd:sequence>
> 					</xsd:complexType>
> 				</xsd:element>
> 			</xsd:sequence>
> 			<xsd:attribute name="name" type="xsd:string"/>
> 		</xsd:complexType>
> 		<xsd:key name="itemKey">
> 			<xsd:selector xpath="items/item"/>
> 			<xsd:field xpath="@code"/>
> 		</xsd:key>
> 	</xsd:element>
> </xsd:schema>
> ***********************
> and sample XML
> ***********************
> <?xml version="1.0" encoding="UTF-8"?>
> <!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
> <supermarket xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\tmp\Supermarket.xsd" name="String">
> 	<aisle name="String" number="2">
> 		<item code="1234" quantity="2" price="3.1415926535897932384626433832795">String</item>
> 	</aisle>
> 	
> 	<items>
> 		<item code="1234">Java</item>
> 	</items>
> </supermarket>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (XMLBEANS-38) Does not support xs:key (keyRef NoIllegalEntries)

Posted by "Radu Preotiuc-Pietro (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-38?page=history ]
     
Radu Preotiuc-Pietro resolved XMLBEANS-38:
------------------------------------------

     Resolution: Invalid
    Fix Version: unspecified

This, in fact, works as designed, it seems that XMLSpy is wrong.
According to http://www.w3.org/TR/xmlschema-1/#d0e13819, clause 4.3, the key has to be in the same subtree as the keyref for it to be succesfully found, which doesn't happen in your example.
If you move your keyref up one level, it will work.

> Does not support xs:key (keyRef NoIllegalEntries)
> -------------------------------------------------
>
>          Key: XMLBEANS-38
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-38
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 1, Version 2, Version 1.0.3, Version 2 Beta 1
>  Environment: Linux J2SEE 1.4.1_05
>     Reporter: Drew Kurry
>     Assignee: Radu Preotiuc-Pietro
>      Fix For: unspecified

>
> XMLBeans does not support the <xs:key name=""> feature used in XSD Schema.  I have tried multiple schemas using this feature and when I go to validate an XML document, I get the same error:
> Key '<the-name-of-your-key' not found (keyRef NoIllegalEntries)
> I am sure this is valid syntax as XML Spy and other editors are ok with the key ref tag as this is supported within XSD.  
> I have included a sample XSD and XML document that includes these values.
> <?xml version="1.0"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:element name="supermarket">
> 		<xsd:complexType>
> 			<xsd:sequence>
> 				<xsd:element name="aisle" maxOccurs="unbounded">
> 					<xsd:complexType>
> 						<xsd:sequence>
> 							<xsd:element name="item" maxOccurs="unbounded">
> 								<xsd:complexType>
> 									<xsd:simpleContent>
> 										<xsd:extension base="xsd:string">
> 											<xsd:attribute name="code" type="xsd:positiveInteger"/>
> 											<xsd:attribute name="quantity" type="xsd:positiveInteger"/>
> 											<xsd:attribute name="price" type="xsd:decimal"/>
> 										</xsd:extension>
> 									</xsd:simpleContent>
> 								</xsd:complexType>
> 							</xsd:element>
> 						</xsd:sequence>
> 						
> 						<!-- Attribute Of Aisle -->
> 						<xsd:attribute name="name" type="xsd:string"/>
> 						<xsd:attribute name="number" type="xsd:positiveInteger"/>
> 					     <!-- Of Aisle -->
> 					
> 					</xsd:complexType>
> 					
> 					<xsd:keyref name="NoIllegalEntries" refer="itemKey">
> 						<xsd:selector xpath="item"/>
> 						<xsd:field xpath="@code"/>
> 					</xsd:keyref>
> 				</xsd:element>
> 				<xsd:element name="items">
> 					<xsd:complexType>
> 						<xsd:sequence>
> 							<xsd:element name="item" maxOccurs="unbounded">
> 								<xsd:complexType>
> 									<xsd:simpleContent>
> 										<xsd:extension base="xsd:string">
> 											<xsd:attribute name="code" type="xsd:positiveInteger"/>
> 										</xsd:extension>
> 									</xsd:simpleContent>
> 								</xsd:complexType>
> 							</xsd:element>
> 						</xsd:sequence>
> 					</xsd:complexType>
> 				</xsd:element>
> 			</xsd:sequence>
> 			<xsd:attribute name="name" type="xsd:string"/>
> 		</xsd:complexType>
> 		<xsd:key name="itemKey">
> 			<xsd:selector xpath="items/item"/>
> 			<xsd:field xpath="@code"/>
> 		</xsd:key>
> 	</xsd:element>
> </xsd:schema>
> ***********************
> and sample XML
> ***********************
> <?xml version="1.0" encoding="UTF-8"?>
> <!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
> <supermarket xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\tmp\Supermarket.xsd" name="String">
> 	<aisle name="String" number="2">
> 		<item code="1234" quantity="2" price="3.1415926535897932384626433832795">String</item>
> 	</aisle>
> 	
> 	<items>
> 		<item code="1234">Java</item>
> 	</items>
> </supermarket>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (XMLBEANS-38) Does not support xs:key (keyRef NoIllegalEntries)

Posted by xm...@xml.apache.org.
The following comment has been added to this issue:

     Author: Jacob Danner
    Created: Wed, 29 Sep 2004 2:11 PM
       Body:
Test Result output:  
  [junit] Invalid doc, expected a valid doc:
    [junit] Instance(0):
    [junit] <!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmls
py.com)--><supermarket xsi:noNamespaceSchemaLocation="jira38.xsd" name="String"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    [junit] <aisle name="String" number="2">
    [junit] <item code="1234" quantity="2" price="3.1415926535897932384626433832
795">String</item>
    [junit] </aisle>
    [junit] <items>
    [junit] <item code="1234">Java</item>
    [junit] </items>
    [junit] </supermarket>
    [junit] Dump:
    [junit]   from splay 1
    [junit]      1: [1]DOC - TYPE pos: 0 - CURSOR pos: 0 id: 1
    [junit]      2: <!--Sample XML file generated by XMLSPY ...-->
    [junit]      3: <supermarket>"\n"
    [junit]      4:   #xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    [junit]      5:   @{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSch
emaLocation="jira38.xsd"
    [junit]      6:   @name="String"
    [junit]      7:   <aisle>"\n"
    [junit]      8:     @name="String"
    [junit]      9:     @number="2"
    [junit]     10:     <item>"String"</item/>"\n"
    [junit]     11:     @code="1234"
    [junit]     12:     @quantity="2"
    [junit]     13:     @price="3.1415926535897932384626433832795"
    [junit]     14:   [2]</aisle/>" \n" - CURSOR pos: 0 id: 2
    [junit]     15:   <items>"\n"
    [junit]     16:     <item>"Java"</item/>"\n"
    [junit]     17:     @code="1234"
    [junit]     18:   </items/>"\n"
    [junit]     19: </supermarket/>
    [junit]     20: ROOT
    [junit] Errors:

    [junit] error: Key '1234' not found (keyRef NoIllegalEntries)

---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XMLBEANS-38?page=comments#action_53520

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-38

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-38
    Summary: Does not support xs:key (keyRef NoIllegalEntries)
       Type: Bug

     Status: Open
   Priority: Major

    Project: XMLBeans
   Versions:
             Version 1

   Assignee: Dave Remy
   Reporter: Drew Kurry

    Created: Fri, 18 Jun 2004 10:23 AM
    Updated: Wed, 29 Sep 2004 2:11 PM
Environment: Linux J2SEE 1.4.1_05

Description:
XMLBeans does not support the <xs:key name=""> feature used in XSD Schema.  I have tried multiple schemas using this feature and when I go to validate an XML document, I get the same error:

Key '<the-name-of-your-key' not found (keyRef NoIllegalEntries)

I am sure this is valid syntax as XML Spy and other editors are ok with the key ref tag as this is supported within XSD.  

I have included a sample XSD and XML document that includes these values.

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="supermarket">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="aisle" maxOccurs="unbounded">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
											<xsd:attribute name="quantity" type="xsd:positiveInteger"/>
											<xsd:attribute name="price" type="xsd:decimal"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
						
						<!-- Attribute Of Aisle -->
						<xsd:attribute name="name" type="xsd:string"/>
						<xsd:attribute name="number" type="xsd:positiveInteger"/>
					     <!-- Of Aisle -->
					
					</xsd:complexType>
					
					<xsd:keyref name="NoIllegalEntries" refer="itemKey">
						<xsd:selector xpath="item"/>
						<xsd:field xpath="@code"/>
					</xsd:keyref>
				</xsd:element>
				<xsd:element name="items">
					<xsd:complexType>
						<xsd:sequence>
							<xsd:element name="item" maxOccurs="unbounded">
								<xsd:complexType>
									<xsd:simpleContent>
										<xsd:extension base="xsd:string">
											<xsd:attribute name="code" type="xsd:positiveInteger"/>
										</xsd:extension>
									</xsd:simpleContent>
								</xsd:complexType>
							</xsd:element>
						</xsd:sequence>
					</xsd:complexType>
				</xsd:element>
			</xsd:sequence>
			<xsd:attribute name="name" type="xsd:string"/>
		</xsd:complexType>
		<xsd:key name="itemKey">
			<xsd:selector xpath="items/item"/>
			<xsd:field xpath="@code"/>
		</xsd:key>
	</xsd:element>
</xsd:schema>

***********************
and sample XML
***********************
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<supermarket xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\tmp\Supermarket.xsd" name="String">
	<aisle name="String" number="2">
		<item code="1234" quantity="2" price="3.1415926535897932384626433832795">String</item>
	</aisle>
	
	<items>
		<item code="1234">Java</item>
	</items>
</supermarket>





---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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