I don't think this has anything to do with a DTD declaration. To my
knowledge, xmlbeans does not process the DTD anyway.
The error you get tells me that this issue is with the content in the
<id /> element.
The way its defined in your instance '&marketing_grp;' will make most
parsers errors because when values are entitized they are preceded with
& and followed by ;. For example, > becomes &gt;
It looks like xmlbeans recognized content meeting the criteria and tried
to map it to a value. Since your value has no mapping to a character,
the parse failed.
I guess the next step would be to look at why you need the content
defined as such and/or create the content using entitized values
(&ampmarketing_grp;) since you are not using xmlbeans to create it. 
Also, I think you'll face this issue with most parsers you use, so it
may be easiest to fix how you are creating the content.
-Jacobd
For some more info on entities:
http://www.w3schools.com/tags/ref_entities.asp

-----Original Message-----
From: Jones, Damon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 05, 2005 4:25 PM
To: [email protected]
Subject: Reading entity information from a DTD within the XMLBean

Hi,

I have XML documents which contain entities. The definitions for the
entities are within a DTD file that is in the same directory as the XML
file. When I try to read the following XML into my XMLBean:

------------------------------------------------------------------------
-----------------------------------
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!-- This is a comment after the first line-->
<!DOCTYPE csf-inputs SYSTEM "my_definitions.dtd">

<inputs>
        <id>&marketing_grp;</id>
        <address>342 Carlton Way</address>

</inputs>
------------------------------------------------------------------------
-----------------------------------

I get the following error:


org.apache.xmlbeans.XmlException: d:\data\user101\My
Documents\inputs_orig.xml:7: error: Reference to undefined entity:
marketing_grp
        at
org.apache.xmlbeans.impl.newstore2.Locale$SaxLoader.load(Locale.java:278
8)
        at
org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:1
101)
        at
org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:1
094)
        at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoa
derBase.java:334)
        at
org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoa
derBase.java:241)

Am I referencing the DTD file in the wrong manner? Is there a better way
to do this.

thanks,
Damon

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to