[xml] XML Parser with *stealing behaviour*

Dear all,
I'm facing with a quite strange problem regarding the parser.

I've to access a service that publishes assertions regarding users in
SIGNED XML files. For example, if I point my application to

I receive a signed xml file with some informations.

My application access quite often to this service. The first time I
access and receive xml there are no problems :

1)  doc = xmlReadFile(xml_file, NULL, 0); ok, doc is not NULL and if I
do an xmlDocDump(stdout, doc); I can see the perfect replication of the
file downloaded.
2) the verification of sign ends succefully.

The second time :

1) I access to another file but the verification of sign fails.

The problem regards the setup of doc structure :

1) doc = xmlReadFile(xml_file, NULL, 0);
2) xmlDocDump(stdout, doc); Now I can see my xml all to a SINGLE
LINE !!! As if the parser decides to _steal_ all '\n'.

From the service I receive the XML in a correct way (checking byte per
byte). I've also tryed to save the stream received from service and save
all in string null-point terminated and then trying


but domping it xmlDocDump(stdout, doc) I obtain always the XML in a
single line without my '\n'.

Obviously, before any access to the server, I call a deinitEnv function
that clean everithing from the doc to the parser.

These '\n' are important for sign verify because with an XML like


the process fails because it want somethin like

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#";>

with no exception to reach correctly every node.

Does anybody have an idea where my '\n's are ?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]