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 2002/06/21 16:32:35 UTC

DO NOT REPLY [Bug 10121] New: - Problem with DOCTYPE tag

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=10121>.
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=10121

Problem with DOCTYPE tag

           Summary: Problem with DOCTYPE tag
           Product: Xerces2-J
           Version: 2.0.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: DTD
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: michael.hjembaek@get2net.dk


Hi there

I am using the Xerces-2 sample program dom.Writer for parsing an XML doc, that 
references another XML doc. Both documents are validated using XML Schema.

After i've included the following lines in my setup.xml doc:
<!DOCTYPE setup [
	<!ENTITY radar3d SYSTEM "3dradar.xml">
]>


I get the following errors:

C:\Tools\xerces\2.0.1\samples>java dom.Writer -v -s -f -c setup.xml
[Error] setup.xml:10:2: Element type "setup" must be declared.
[Error] setup.xml:11:47: Element type "group1" must be declared.
[Error] setup.xml:12:50: Element type "group2" must be declared.
[Error] setup.xml:13:44: Element type "group3" must be declared.
[Error] 3dradar.xml:7:2: Element type "functionset" must be declared.
[Error] 3dradar.xml:8:42: Element type "tab" must be declared.
[Error] 3dradar.xml:9:80: Element type "function" must be declared.
[Error] 3dradar.xml:10:69: Element type "function" must be declared.
[Error] 3dradar.xml:11:78: Element type "function" must be declared.

I've used the newest version of XML Spy to validate my xml / xsd files - and 
they turn out to be valid. I am not that experienced in xml / xml schema, but I 
suspect that the schema parser should not try to validate <!DOCTYPE ...> tags.

Hope to hear from you soon.

Kind regards,

Michael Hjembaek

/////////////////////////////////////////////////////////////////

The following is the content of the XML / XML Schema files used:

setup.xml
=========
<?xml version='1.0' encoding='ISO-8859-1'?>

<!-- these lines cause the errors -->
<!DOCTYPE setup [
	<!ENTITY radar3d SYSTEM "3dradar.xml">
]>

<setup 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation='setup.xsd'
>
	<group1 name="Applica.\nTID" row="0" col="0">
		<group2 name="Sensor\nControl" row="0" col="0">
			<group3 name="3D radar" row="0" col="0">
				&radar3d;
			</group3>
		</group2>
	</group1>
</setup>


3dradar.xml
===========
<?xml version='1.0' encoding='ISO-8859-1'?>

<!-- nsprefix (namespace prefix) is used as a prefix for all function id's -->
<functionset nsprefix="com.terma.cflex.applicationframework.3dradar" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation='setup.xsd'
>
    <tab index="0" name="Radar\ncontrol">
        <function row="0" col="0" id="transmiton"   name="Trans-\nmitter\nON"/>
        <function row="0" col="4" id="stcon"        name="STC\nON"/>
        <function row="1" col="4" id="sectormodeon" name="Sector\nmode\nON"/>
    </tab>
</functionset>


setup.xsd
=========
<?xml version='1.0' encoding='ISO-8859-1'?>
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
            
	<!-- definition of named types -->
	<xs:simpleType name="rowType">
	  	<xs:restriction base="xs:string">
	    	<xs:pattern value="[0-9]{1}"/>
	  	</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="indexType">
	  	<xs:restriction base="xs:string">
	    	<xs:pattern value="[0-9]{1}"/>
	  	</xs:restriction>
	</xs:simpleType>
		
	
	<!-- definition of attributes -->
	<!--<xs:attribute name="col"      type="colType"/>-->
	<xs:attribute name="col"      type="xs:integer"/>
	<xs:attribute name="id"       type="xs:string"/>
	<xs:attribute name="index"    type="indexType"/>
	<xs:attribute name="name"     type="xs:string"/>
	<xs:attribute name="row"      type="rowType"/>
	<xs:attribute name="nsprefix" type="xs:string"/>
	
	<xs:attribute name="src" type="xs:anyURI"/>	

	<!-- definition of complex type elements -->
	<xs:element name="setup">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="group1" minOccurs='0' 
maxOccurs='8'/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="group1">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="group2" minOccurs='0' 
maxOccurs='11'/>
			</xs:sequence>
			<xs:attribute ref="row"  use='required'/>
			<xs:attribute ref="col"  use='required'/>
			<xs:attribute ref="name" use='required'/>		
	
		</xs:complexType>
	</xs:element>
	
	<xs:element name="group2">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="group3" minOccurs='0' 
maxOccurs='22'/>
			</xs:sequence>
			<xs:attribute ref="row"  use='required'/>
			<xs:attribute ref="col"  use='required'/>
			<xs:attribute ref="name" use='required'/>		
	
		</xs:complexType>
	</xs:element>
	
	<xs:element name="group3">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="functionset" minOccurs='0' 
maxOccurs='1'/>
			</xs:sequence>
			<xs:attribute ref="row"  use='required'/>
			<xs:attribute ref="col"  use='required'/>
			<xs:attribute ref="name" use='required'/>		
	
		</xs:complexType>
	</xs:element>
	
	<xs:element name="functionset">
		<xs:complexType>			
			<xs:sequence>
				<xs:element ref="tab" minOccurs='0' 
maxOccurs='10'/>
			</xs:sequence>
			<xs:attribute ref="nsprefix"/>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="tab">
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="function" minOccurs='0' 
maxOccurs='40'/>
			</xs:sequence>
			<xs:attribute ref="index" use='required'/>
			<xs:attribute ref="name"  use='required'/>		
	
		</xs:complexType>		
	</xs:element>
	
	<xs:element name="function">
		<xs:complexType>	
			<xs:attribute ref="row"  use='required'/>
			<xs:attribute ref="col"  use='required'/>
			<xs:attribute ref="id"   use='required'/>
			<xs:attribute ref="name" use='required'/>
			<!-- definition of unique attributes
			<xs:key name="charName">
				<xs:selector xpath="function"/>
				<xs:field xpath="id"/>
			</xs:key>
			-->			
		</xs:complexType>
	</xs:element>

</xs:schema>

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