Zeus (b3_5): Unable to handle recursive DTD

"Darby, Chad" <[email protected]> Tue, 01 Oct 2002 16:14:22 -0400
Newsgroups gmane.comp.java.enhydra.zeus
Message-ID <[email protected]>
Hi All,

I've been using Zeus for about 6 months now on various projects. I'm very
pleased w/ the product since it has save me tons of time :-)  However, I
have this one DTD and sample XML file that I can't process.  The DTD uses=
 a
recursive definition and it seems to cause problems w/ Zeus (b3_5).  The =
DTD
and sample XML files are at the bottom of the e-mail.

When I attempt to marshal the object, I encounter a NullPointerException.
Has anyone else encountered a similar problem?  I'm using Zeus b3_5, JDK
1.4.0, Windows NT.


Here's the stack trace.

C:\alpha>ant run-test > output.txt
     [java] java.lang.NullPointerException
     [java]     at java.io.Writer.write(Writer.java:126)
     [java]     at core.dcr.ItemImpl.writeXMLRepresentation(Unknown Sourc=
e)
     [java]     at core.dcr.RecordImpl.writeXMLRepresentation(Unknown
Source)
     [java]     at core.dcr.RecordImpl.marshal(Unknown Source)
     [java]     at core.dcr.RecordImpl.marshal(Unknown Source)
     [java]     at core.Test.main(Unknown Source)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
     [java]     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:324)
     [java]     at
org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.jav
a:208)
     [java]     at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava
.java:150)
     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:415)
     [java]     at
org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)

     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:1=
08)
     [java]     at org.apache.tools.ant.Task.perform(Task.java:317)
     [java]     at org.apache.tools.ant.Target.execute(Target.java:309)
     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:3=
34)
     [java]     at
org.apache.tools.ant.Project.executeTarget(Project.java:1306)

     [java]     at
org.apache.tools.ant.Project.executeTargets(Project.java:1250
)
     [java]     at org.apache.tools.ant.Main.runBuild(Main.java:610)
     [java]     at org.apache.tools.ant.Main.start(Main.java:196)
     [java]     at org.apache.tools.ant.Main.main(Main.java:235)


Here's the DTD file:  "dcr.dtd"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!ELEMENT item (value*)>
<!ATTLIST item
	name CDATA #REQUIRED
>

<!ELEMENT record (item+)>
<!ATTLIST record
	dcrname CDATA #REQUIRED
	dctname CDATA #REQUIRED
	type CDATA #REQUIRED
>

<!ELEMENT value (#PCDATA | item)*>



Here's the sample XML file:  "sample_data.xml"

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<!DOCTYPE record SYSTEM "dcr.dtd">
<record dcrname=3D"Introduction.xml" dctname=3D"dz_123" type=3D"content">
	<item name=3D"Title">
		<value>Getting to Know Your Family</value>
	</item>
	<item name=3D"Main Text">
		<value>Your ultimate goal is to know you family</value>
	</item>
	<item name=3D"Rollover Text List">
		<value>
			<item name=3D"Rollover Title">
				<value/>
			</item>
			<item name=3D"Rollover Text">
				<value/>
			</item>
		</value>
		<value>
			<item name=3D"Rollover Title">
				<value/>
			</item>
			<item name=3D"Rollover Text">
				<value/>
			</item>
		</value>
	</item>
	<item name=3D"Conclusion">
		<value>In conclusion...</value>
	</item>=09
</record>




Ch=E1d (shod) Darby
215-631-5216
[email protected]



-------------------------------------------------------------------------=
-----
Notice:  This e-mail message, together with any attachments, contains inf=
ormation of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that =
may be confidential, proprietary copyrighted and/or legally privileged, a=
nd is intended solely for the use of the individual or entity named in th=
is message.  If you are not the intended recipient, and have received thi=
s message in error, please immediately return this by e-mail and then del=
ete it.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D