I have an XML file that looks something like this:
<opt>
<A>
<B>
<C>
<x>123</x>
</C>
</B>
</A>
</opt>
Then, using XML::Simple, I do XMLin() and XMLout() on it and it returns something looking like this:
<opt>
<A name="B">
<C>
<x>123</x>
</C>
</A>
</opt>
This second way parses the same way with XMLin() as the first one, and then I add a field using a certain function
and then XMLout() returns it yet again a different way:
<opt>
<A name="B">
<B name="C">
<x>456</x>
</B>
<C x="123" />
</A>
</opt>
This of course does not parse correctly with XMLin() causing my functions that operate on it to be useless.
Now the question: is there any module or method that I can use that will allow me to keep the initial XML format throughout the runnings of the program?
Zenon Zabinski | zdog | zdog7@hotmail.com
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|