Modifying XML Document

R

Roger Wilco

I have a C++ application that uses an XML config file. It periodically
needs to move a line (XML element) to the end of the file. I've
written this using the C++ Xerces libraries (v2.5). The problem is
that whitespacing gets REALLY screwed up. I'm not too concerned with
looks, but this will start to get really ugly after running several
hundred times.

FYI, I'm using fgDOMWRTFormatPrettyPrint and have tried disabling
that.

The original looks something like:

<?xml version="1.0" encoding="ascii" standalone="no" ?>

<file>
<entry>item 1</entry>
<entry>item 2</entry>
<entry>item 3</entry>
<entry>item 4</entry>
</file>

After moving the first entry to the bottom, I get something like this:

<?xml version="1.0" encoding="ascii" standalone="no" ?>
<recipientLists defaultSchemaPath="..\AddressLists\schema.txt">

<entry>item 2</entry>



<entry>item 3</entry>



<entry>item 4</entry>



<entry>item 1</entry>


</recipientLists>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top