Subject: | domReadWellBalancedString() is never used to read a string directly into the context of a document |
Hi,
after discussing this issue with a colleague, I figured out that
XML::LibXML does not allow developers to parse a XML chunk directly into
the context of a document. This is interesting because all internal
function would support this.
Parsing a chunk directly into a Document would make an additional import
of the the fragment unnecessary.
A possible solution would be to add an optional document node parameter
to parse_xml_chunk().
The interface of parse_balanced_chunk() would allow then the following
syntax:
$fragment = $parser->parse_balanced_chunk($chunk, $encoding, $document);
This would speed up DOM operations when the fragment is inserted into
the document.
Best
Christian