[lxml] Re: ElementTree function insert() to accept negative value.

2025-06-14 Thread Schimon Jehudah via lxml - The Python XML Toolkit
Greetings. Alternatively, it would probably be good to add a new keyword argument to function write() to xml.etree.ElementTree. def write(self, file_or_filename, encoding=None, xml_declaration=None, default_namespace=None, method=None, *

[lxml] Re: Appending XSLT to XML

2025-06-14 Thread Schimon Jehudah via lxml - The Python XML Toolkit
Greetings. I want to append instructions for XSLT without converting an XML object to string. Is there a solution for doing so, yet? This code: import xml.etree.ElementTree as ET e_feed = ET.Element("feed") e_feed.set("xmlns", "http://www.w3.org/2005/Atom";) xslt_reference = ET.ProcessingInstr

[lxml] ElementTree function insert() to accept negative value.

2025-06-14 Thread Schimon Jehudah via lxml - The Python XML Toolkit
Greetings. This code: import xml.etree.ElementTree as ET e_feed = ET.Element("feed") e_feed.set("xmlns", "http://www.w3.org/2005/Atom";) xslt_reference = ET.ProcessingInstruction( "xml-stylesheet", "type=\"text/xml\" href=\"stylesheet.xsl\"") e_feed.insert(0, xslt_reference) Would yield