C
Christian Schmidbauer
Hello!
I prepare my XML document like this way:
-------------------------------------------------------
PrintWriter writer;
Document domDocument;
Element domElement;
// Root tag
domElement = domDocument.createElement ("ROOT_TAG");
domDocument.appendChild (domElement);
// XML from an external source as a "String"
Text data = domDocument.createTextNode (externalXML);
domElement.appendChild (data);
writer.println (...);
-------------------------------------------------------
As you can see, I create a normal Root-Node and then I get an XML
stream from an external source. For the external XML I use the
function "createTextNode" because it is a text in some way.
The problem is the output when I write all together to the PrintWriter
object. It looks like this for this example:
--------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ROOT_TAG>
<DATA>
<AFL>
<AFLNR>XX</AFLNR>
<BENENNUNG>MY TEST</BENENNUNG>
<LA_VER></LA_VER>
<FA_KR></FA_KR>
<POL_COD></POL_COD>
<FA_KZ></FA_KZ>
<G_KZ></G_KZ>
<AFL_KZ>1</AFL_KZ>
</AFL>
</DATA>
</ROOT_TAG>
--------------------------------------------------------------
Strange, isn't it!? The sign "<" is being replaced by "<" and ">"
is being replaced by ">", but only for the XML coming from the
external source.
Does anybody know this problem or can think about a solution? Should I
use another function than "createTextNode" or do I have to change the
special characters manually?
Thank you for every hint!
Best regards,
Christian Schmidbauer
I prepare my XML document like this way:
-------------------------------------------------------
PrintWriter writer;
Document domDocument;
Element domElement;
// Root tag
domElement = domDocument.createElement ("ROOT_TAG");
domDocument.appendChild (domElement);
// XML from an external source as a "String"
Text data = domDocument.createTextNode (externalXML);
domElement.appendChild (data);
writer.println (...);
-------------------------------------------------------
As you can see, I create a normal Root-Node and then I get an XML
stream from an external source. For the external XML I use the
function "createTextNode" because it is a text in some way.
The problem is the output when I write all together to the PrintWriter
object. It looks like this for this example:
--------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ROOT_TAG>
<DATA>
<AFL>
<AFLNR>XX</AFLNR>
<BENENNUNG>MY TEST</BENENNUNG>
<LA_VER></LA_VER>
<FA_KR></FA_KR>
<POL_COD></POL_COD>
<FA_KZ></FA_KZ>
<G_KZ></G_KZ>
<AFL_KZ>1</AFL_KZ>
</AFL>
</DATA>
</ROOT_TAG>
--------------------------------------------------------------
Strange, isn't it!? The sign "<" is being replaced by "<" and ">"
is being replaced by ">", but only for the XML coming from the
external source.
Does anybody know this problem or can think about a solution? Should I
use another function than "createTextNode" or do I have to change the
special characters manually?
Thank you for every hint!
Best regards,
Christian Schmidbauer