You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2005/03/18 01:50:23 UTC

DO NOT REPLY [Bug 34065] New: - E

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

http://issues.apache.org/bugzilla/show_bug.cgi?id=34065

           Summary: E
           Product: Xerces-J
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: Xerces2
          Severity: critical
          Priority: P1
         Component: Schema-Structures
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: chavarao@yahoo.com


Hi,

I have a question about XML Validation feature of Xerces-Java2.6.2

Currently, I am trying to validate schema with two local elements enclosed into 
different groups. The reason why I have two local elements with same name is 
because I am trying to map a protocol so that element names and values in 
protocol have to match the schema. Also, both elements have same attributes, 
they both have different enumerations. So when REF apprears first time, it can 
only have two values F1 and F2. Wjen REF appears second time it can only have 
A1 and A2.

The schema validates just fine with XMLSPY 2004 however it failes to validate 
in XMLSPY2005 and in Intelij as well.

Here is my schema and xml examples:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:element name="ROOT">
		<xs:annotation>
			<xs:documentation>Comment describing your root 
element</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:group ref="REF1" minOccurs="0"/>
				<xs:group ref="REF2" minOccurs="0"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:group name="REF1">
		<xs:sequence>
			<xs:element name="REF">
				<xs:annotation>
					<xs:documentation>REFERENCE 
IDENTIFIER</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:attribute name="REF1" 
use="required">
						<xs:simpleType>
							<xs:restriction 
base="xs:string">
								<xs:enumeration 
value="F1"/>
								<xs:enumeration 
value="F2"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
					<xs:attribute name="REF2" 
type="xs:string" use="required"/>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:group>
	<xs:group name="REF2">
		<xs:sequence>
			<xs:element name="REF">
				<xs:annotation>
					<xs:documentation>REFERENCE 
QUALIFIER</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:attribute name="REF1" 
use="required">
						<xs:simpleType>
							<xs:restriction 
base="xs:string">
								<xs:enumeration 
value="A1"/>
								<xs:enumeration 
value="A2"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
					<xs:attribute name="REF2" 
type="xs:string" use="required"/>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
	</xs:group>
</xs:schema>

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XML Spy v4.0 U (http://www.xmlspy.com)-->
<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="C:\Documents and 
Settings\MVeksler\Desktop\SAMPLE1.xsd">
	<REF REF1="F1" REF2="String"/>
	<REF REF1="A1" REF2="String"/>
</ROOT>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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