commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From haipeng du <haipen...@gmail.com>
Subject parsing error
Date Sat, 05 Feb 2005 00:30:44 GMT
When I use commons digester to parse my xml file, i got the exception:
org.xml.sax.SAXParseException: more pseudo attributes is expected.
my DTD file looks like:

<?xml version="1.0" ?>
<!DOCTYPE document-type [
	
	<!--
		Root elemenet "document":
		      name: document type name
			  extends: parent documents file name, with order. If two document
type contain the same metadata, use the first one
			           if this file also contains the same meta field, use this file's
			  allow-custom-meta: if user can add their own meta field into document.
			  description: descripe the document.
			  type: what kind of document defined, such as pdf
			  user: only whom can use this document, if not specified, all user
can user that
			  meta-fields: system meta data fields that document has
		-->
	<!ELEMENT document-type ( description?, roles?, meta-fields? )>
	    <!ATTLIST document-type name CDATA #REQUIRED>
	    <!ATTLIST document-type extends CDATA #IMPLIED>
		<!ATTLIST document-type allow-custom-fields (true | false) "true" >
	    <!ELEMENT description (#PCDATA) >
		
	    <!ELEMENT roles (role*) >
		   <!ELEMENT role (description?)>
		   <!ATTLIST role id CDATA #REQUIRED>
		   <!ATTLIST role name CDATA #IMPLIED >
		<!-- meta-fields: define what kind of system meta data fields that
document has
		-->
	    <!ELEMENT meta-fields ( meta-field* ) >
		<!-- meta-field: one meta field in the document.
			     name: filed name
				 required: if this field must be filled.
				 class: what is the class of field value. default is
"java.lang.String".(future feature)
				 default: default value of this field
		-->
	       <!ELEMENT meta-field ( description?, default-value,display-name )>
	          <!ATTLIST meta-field name CDATA #REQUIRED>
			  <!ATTLIST meta-field required (true | false) "true" >			  
	          <!ATTLIST meta-field class CDATA "java.lang.String" >
	          <!ELEMENT default-value (#PCDATA) >
			  <!ELEMENT display-name (#PCDATA) >
]>

and xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE document-type SYSTEM 'document-type.dtd"> 


<document-type name="pdfDoctype" extends="test1.xml,test2.xml"
	           allow-custom-fields="true" >
	<description>
		this file define the metadata fields for pdf document type
	</description>
	
	<roles>
		<role id="1" name="testrole1">
			<description>
				Not known role
			</description>
		</role>
		<role id="2" name="testrole2">
			<description>
				Test role 2
			</description>
		</role>
	</roles>
	<meta-fields>
		<meta-field required="true" name="fileName">
			<description>Name of file</description>
			<default-value>test.pdf</default-value>
			<display-name>File Name</display-name>
		</meta-field>
		<meta-field required="true" name="fileAuthor" >
			<description>Author of file</description>
			<default-value>Haipeng</default-value>
			<display-name>File Author</display-name>
		</meta-field>
	</meta-fields> 
	 
	
</document-type>
>From website, somebody said I can change doctype to:
<!DOCTYPE document-type PUBLIC "-//Sun Microsystems, Inc.//DTD Java
Data Objects Metadata 1.0//EN" "document-type.dtd">
But it still does not work.
Could somebody give me the solutions for this?
Thanks a lot.
-- 
Haipeng Du
Software Engineer
Comphealth, 
Salt Lake City

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message