Four Js Development Tools Forum

Discussions by product => Genero BDL => Topic started by: Andrew Clarke on October 28, 2009, 05:19:04 AM

Title: Changing the XML encoding of a file to be written
Post by: Andrew Clarke on October 28, 2009, 05:19:04 AM
Hey folks,

I'm building a DOM (om?) tree under an DomDocument and then writing it to a file:

Code (genero) Select

let doc = om.DomDocument.create("testsuite")
let dnRoot = doc.getDocumentElement()
### BUILD A TREE under dnRoot
# dump the document
call dnRoot.writeXml("test.xml")


However the emitted file has a default encoding that I want to be UTF-8:

Code (xml) Select
<?xml version='1.0' encoding='ANSI_X3.4-1968'?>

How can I affect the encoding? I don't want to have to manually emit the document using a SAX writer, but I guess I will if I have to...

Current version Genero is 2.11 but 2.20 is very close for us, and I can wait for that if it can do it more easily.
Title: Re: Changing the XML encoding of a file to be written
Post by: Reuben Barclay on October 28, 2009, 06:20:26 AM
Hi Andrew,

Did you see this discussion from a few months ago https://4js.com/fjs_forum/index.php?topic=338.0

Reuben
Title: Re: Changing the XML encoding of a file to be written
Post by: Andrew Clarke on October 28, 2009, 07:12:28 AM
No, but I have now! Thanks, that answers the question, and also tells me I need not worry for normal ASCII output that is the TRUE output of my process.

cheers