When loading in an xml file $qp = qp($xml_in); which has " and ' in the element values, $qp->writeXML($xml_out); will return values with " and '. Is this expected behaviour?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mscore_en_GB.ts_.txt | 274.61 KB | toemaz |
When loading in an xml file $qp = qp($xml_in); which has " and ' in the element values, $qp->writeXML($xml_out); will return values with " and '. Is this expected behaviour?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | mscore_en_GB.ts_.txt | 274.61 KB | toemaz |
Comments
Comment #1
toemaz commentedWhen loading in an xml file $qp = qp($xml_in); which has
"and'in the element values, $qp->writeXML($xml_out); will return values with"and'. Is this expected behaviour?Comment #2
toemaz commentedSorry. Problem caused by something else.
Comment #3
toemaz commentedI'm reopening this support request again. I thought the problem was caused by something else, but I narrowed it down to querypath.
Find attached an xml file which has several encoded
"and'to"and'. This is what XML should be.When I run the following php code:
QueryPath is spitting out non encoded
"and'. I expect the original xml file back instead.Can you help me out?
Comment #4
mbutcher commentedThis is by design -- actually, the encoding/decoding is handled by libxml, the native PHP XML library.
There might be a flag that can be passed into the XML subsystem that will prevent it from doing the decoding. (http://www.php.net/manual/en/book.libxml.php)
I tried parsing the document, rendering it, and then parsing the results to see if the quotes broke it, and they don't seem to. That is not to say, of course, that all XML processors will behave that way. I'll add this to the list of QueryPath bugs at GitHub: http://github.com/technosophos/querypath/issues#issue/15
Comment #5
toemaz commentedThanks for the reply and for adding it to the github issue tracker.
Comment #6
mbutcher commentedI am marking this as closed, since it is not a bug in this module, and is already a ticket in QueryPath's GitHub.