Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml parsing

Status
Not open for further replies.

go1845

Programmer
Mar 26, 2015
1
0
0
IE
I am an xml novice so apologies up front if my question is - well - stupid.

I am investigating a C program that uses the libxml2 xmlreader to parse a string containing an xml message.

The structure of the xml message currently contains elements and attributes arranged as follows:

<Fields>
<Field name="XXXXXXXXX_PAYER_NAME">
<Value>MR JON DOE</Value>
<Change>U</Change>
</Field>
<Field name="XXXXXXXXX_PAYEE_NAME">
<Value>ABCD</Value>
<Change>U</Change>
</Field>
</Fields>


Theres is an intention to change the arrangement of elements and attributes as follows:

<Fields>
<XXXXXXXXX_PAYER_NAME>MR RED BOX</XXXXXXXXX_PAYER_NAME>
<Change>U</Change>
<XXXXXXXXX_PAYEE_NAME>ABCD</XXXXXXXXX_PAYEE_NAME>
<Change>U</Change>
</Fields>

(No doubt there are terms that describe these different formats but I don't know what they are)

My question is: is it likely that the libxml2 xmlreader will correctly parse the new format?

Our system configuration does not allow us to set up a test scenario without a significant overhead so, at this stage, our intention is to wait until the new xml message is up and running in our development environment and then try it and see what happens.

Any help would be gratefully appreciated.

Thanks.
 
From the standpoint of XML qua XML, there is no problem with the new format, as it appears to conform to the requirements of the XML specification for a well-formed XML document.

Of course, your application will be tied to a specific layout of the XML document (element names and attribute names, teee structure), and the new document does not conform to this layout. So, you application will require changes.

If the XXXXXXXX in your example is some dynamic value that changes fom document tp document, then it is an odd XML document - quite an outlier. The original document reminds me of some of the XML documents one sees in payment systems, a rather literal transliteration of the older text files used.

Welcome to Tek-Tips!

Tom Morrison
Hill Country Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top