<html>
<body>
Hi,<br><br>
I have a problem including a process instruction. I want to include the
following PI<br><br>
<br>
<pre><?xml encoding='EUC-JP'?>
</pre>When calling <br>
<x-tab> </x-tab><x-tab> </x-tab>map
= new HashMap();<br>
<x-tab> </x-tab><x-tab> </x-tab>map.put("encoding",thePrefs.getProperty("xml_encoding","utf-8"));<br>
<x-tab> </x-tab><x-tab> </x-tab>pi
= new ProcessingInstruction("xml",map);<br><br>
I get a <pre>org.jdom.IllegalTargetException. Which is OK, cause I'm
trying to create a target which is not allowed. The problem is how do I
include the PI? I can´t use XMLOutputter class cause the Document is used
in a transformation, eg I'm not "outputting" the xml directly.
I have not found any other way to include the PI or set the encoding of
my Document. I need to be able to set the encoding cause my scenario is
the following.
I have a Controller that convert/inserts POJO objects into a JDOM
Document and some of the objects produces characters with special
encoding.
</pre><font face="Courier New, Courier">The JDOM document is then
transformed with an JAXP using <br><br>
TransformerFactory.transform(new JDOMSource(xmlDoc),new
StreamResult(outStream));<br><br>
<br>
When some objects produce characters/text with different encoding I get
an error.<br><br>
Thanks for a great product, been using it since b6. I use v 1.0 of
JDOM<br><br>
Regards<br>
/Rodrigo<br>
</font><x-sigsep><p></x-sigsep>
<font size=4><b>Rodrigo Alvarez Reygadas<br>
</font><i>Director de Innovación Tecnológica<br>
</i>D<font color="#FF0000">y</font>BOX</b> <i>Consulting and
Development<br>
</i><font color="#808080">---------------------------------<br>
Oracle Certified Partner<br>
---------------------------------<br><br>
</font><font face="Arial Narrow, Helvetica"><i>Avda. Providencia 2653
Of.1701 Piso 17<br>
Providencia, Santiago, Chile.<br>
(562) 333 1121<br><br>
</font></i></body>
</html>