when i am creating an dom,i want to specify the encoding as "gb2312",i do the following:
- Posted by: h yt
- Posted on: December 13 2001 22:33 EST
but when i check the produced xml file,i found both the following node existing:
<?xml version="1.0" encoding="UTF-8"?>
i can't find method to trim the first code line using jaxp,what should i do?
- help!how could i change dom's encoding using jaxp? by Gal Binyamini on December 15 2001 17:05 EST
I am assuming you output your DOM using a Transformer (the standard JAXP approach). Add these lines after you create the transformer:
Properties props = new Properties();
This will do the trick. You don't need to add the processing instruction.