@@ -387,6 +387,15 @@ module Lxml {
387387 module ElementTree {
388388 API:: Node classRef ( ) { result = etreeRef ( ) .getMember ( "ElementTree" ) }
389389
390+ /**
391+ * A source of instances of `lxml.etree.ElementTree` instances, extend this class to model new instances.
392+ *
393+ * This can include instantiations of the class, return values from function
394+ * calls, or a special parameter that will be set when functions are called by an external
395+ * library.
396+ *
397+ * Use the predicate `ElementTree::instance()` to get references to instances of `lxml.etree.ElementTree` instances.
398+ */
390399 abstract class InstanceSource extends DataFlow:: LocalSourceNode { }
391400
392401 /** Gets a reference to an `lxml.etree.ElementTree` instance.` */
@@ -397,7 +406,7 @@ module Lxml {
397406 exists ( DataFlow:: TypeTracker t2 | result = instance ( t2 ) .track ( t2 , t ) )
398407 }
399408
400- /** Gets a reference to an `lxml.etree.ElementTree` parsers instance. */
409+ /** Gets a reference to an `lxml.etree.ElementTree` instance. */
401410 DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
402411
403412 /** An `ElementTree` instantiated directly. */
@@ -439,7 +448,9 @@ module Lxml {
439448
440449 /** A call to serialise xml to a string */
441450 private class XmlEncoding extends Encoding:: Range , DataFlow:: CallCfgNode {
442- XmlEncoding ( ) { this = etreeRef ( ) .getMember ( "tostring" ) .getACall ( ) }
451+ XmlEncoding ( ) {
452+ this = etreeRef ( ) .getMember ( [ "tostring" , "tostringlist" , "tounicode" ] ) .getACall ( )
453+ }
443454
444455 override DataFlow:: Node getAnInput ( ) {
445456 result = [ this .getArg ( 0 ) , this .getArgByName ( "element_or_tree" ) ]
0 commit comments