How to force python lxml not to quote attributes with <?php ... ?> inclusions?

101 Views Asked by At

I need to generate html fragments of a php-module with python lxml. My code is rather huge, so it is maybe not necessary to post the whole stuff, but in general it does something like this:

element = html.Element("input", name="field", type="text", value="<?php $field ?>")

The problem is that et.tostring quotes the value, so that the result looks like this:

<input class="ml" type="text" name="field" value="&lt;?php $field ?&gt;">

Expected output should be:

<input class="ml" type="text" name="field" value="<?php $field ?>">

Is it possible to do so?

0

There are 0 best solutions below