[
https://issues.apache.org/jira/browse/XERCESJ-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679580#comment-17679580
]
Elliotte Rusty Harold edited comment on XERCESJ-323 at 6/21/25 12:04 PM:
-------------------------------------------------------------------------
I'm willing to bet this one is working as intended, and should simply be
closed. There's not enough detail here to be certain, but it's probably a case
of someone expecting a parser to round-trip semantically insignificant
differences like CDATA sections and white space inside tags.
was (Author: elharo):
I'm willing to bet this one is working as intended, and should simply be
closed. There's not enough detail here to be certain, but it's probably a case
of someone expecting a parser to round-trip semantically insignificant
differences like CDATA sections and whites pace inside tags.
> XML file format is not maintained
> ---------------------------------
>
> Key: XERCESJ-323
> URL: https://issues.apache.org/jira/browse/XERCESJ-323
> Project: Xerces2-J
> Issue Type: Bug
> Components: Serialization
> Affects Versions: 2.0.0
> Environment: Operating System: Windows 9x
> Platform: PC
> Reporter: sudhirk
>
> Dom parser is changing the format or layout of XML files .
> This makes it extremely difficult to read for validation of functionality.
> code written for serialization is like this:-
> import org.apache.xml.serialize.OutputFormat;
> import org.apache.xml.serialize.XMLSerializer;
> // creating the file output stream of the xml to make the updation
> FileOutputStream fos = new FileOutputStream(fileName);
> // get the dom object for each key value
> Document domObject = (Document) DOMList.get(fileName);
> // creating the output format object, so that xml file is indent properly
> OutputFormat opf = new OutputFormat(domObject);
> opf.setLineSeparator("\n\r");
> opf.setIndenting(true);
> opf.setIndent(GlobalConstants.EDITOR_INDENT);
> //serializing the data in xml file
> XMLSerializer out = new XMLSerializer(fos, opf);
> out.serialize(domObject);
> fos.close();
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]