[xslt] Python bindings, escaping problems



Hi everyone.

I am attempting to parse a number of string parameters using the applyStylesheet(document, parameters_dictionary),
this works as expected and I have properly wrapped the string in quotation marks so that it is interpreted as a string rather than an xpath query.


The string parameters are well formed xml document fragments.

The problem that arises is when the string of one of the parameters is a quotation mark, this closing the string prematurely and causing an parsing error when
trying to read the string.


If I escape the marks to become the string " the string can be properly input as a parameter and the resulting document is created.

This resultant xml document is however not well formed, as many of the quotation mark symbols were marks representing attributes of an element.

What is the proper way to escape the marks so that they can be read in, and when added to the document leave the document well-formed.

I was hoping to be able to add the parameter to the document without needing to escape it within a CDATA section because the input should be well formed xml.

Any help would be great.



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