You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Daniel Pfuhl <da...@web.de> on 2001/04/18 10:34:33 UTC

changing the encoding

Hi

while trying to generate a first xml doc using
xerces an DOM I got this using this code:


        System.setProperty("javax.xml.parsers.DocumentBuilderFactory","org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");



        DocumentBuilder builder = null;
        try {
            builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        } catch (ParserConfigurationException ex) {
            ex.printStackTrace();
            System.exit(-1);
        }


        Document document = builder.newDocument();


        Element root = document.createElement("person");

....

In default an xml-doc will be created wich encoding is "UTF-8"!

How can I change this encoding ??

thanks for pointing me in the right direction ;-)

daniel
______________________________________________________________________________
Die Fachpresse ist sich einig: WEB.DE 20mal Testsieger! Kostenlos E-Mail, 
Fax, SMS, Verschlüsselung, POP3, WAP....testen Sie uns! http://freemail.web.de


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org