The application is Jakarta Struts based. When the form is submitted
the values are stored in Bean e.g. theItem and stored in the DOM tree:
Element elem = getElementByIdAttribute (theItem.getId());
log.trace(theItem.getHeadline());
elem.element("headline").setText(theItem.getHeadline());
When everything is stored I write into a file with the following code:
OutputFormat format = new OutputFormat( "", false, "iso-8859-1");
FileWriter out = new FileWriter(file);
XMLWriter writer = new XMLWriter( out, format );
writer.write( doc );
out.close();
Thanks,
Martin
> Martin,
> When you say submit, what do you do? Can you provide snippets of the
> code? How do you "write" out the DOM tree? Are you using an
> org.dom4j.io.OutputFormat instance combined with the XmlWriter?
> More info please. ;-)
> Thanks,
> Dave
> Martin Gross wrote:
>> hi,
>>
>> this is probably a very basic question, but I still haven't found a
>> solution for it by browsing through the list archive.
>>
>> I have written a web application that generates some xml files with
>> iso-8859-1 encoding. in an dtd file I defined a entity
>> e.g. <!ENTITY trademark "™">.
>>
>> My XML file contains <headline>Test &trademark;</headline>
>>
>> When I parse the document for reading everything works fine. The
>> trademark symbol is properly displayed in the form field of my
>> browser form.
>>
>> But when I submit my form, the trademark symbol is replaced by an
>> question mark: <headline>Test ?</headline>
>>
>> If I write 'Test &trademark;' into the form field the following is
>> written into the xml file: <headline>Test &trademark;</headline>
>>
>> How do I get the entity into the xml file with dom4j?
>>
>> best regards,
>> martin
>>
>>
>>
>> -------------------------------------------------------
>> This SF.net email is sponsored by: Etnus, makers of TotalView, The best
>> thread debugger on the planet. Designed with thread debugging features
>> you've never dreamed of, try TotalView 6 free at www.etnus.com.
>> _______________________________________________
>> dom4j-user mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/dom4j-user
>>
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user