@@ -387,6 +387,15 @@ module Lxml {
387
387
module ElementTree {
388
388
API:: Node classRef ( ) { result = etreeRef ( ) .getMember ( "ElementTree" ) }
389
389
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
+ */
390
399
abstract class InstanceSource extends DataFlow:: LocalSourceNode { }
391
400
392
401
/** Gets a reference to an `lxml.etree.ElementTree` instance.` */
@@ -397,7 +406,7 @@ module Lxml {
397
406
exists ( DataFlow:: TypeTracker t2 | result = instance ( t2 ) .track ( t2 , t ) )
398
407
}
399
408
400
- /** Gets a reference to an `lxml.etree.ElementTree` parsers instance. */
409
+ /** Gets a reference to an `lxml.etree.ElementTree` instance. */
401
410
DataFlow:: Node instance ( ) { instance ( DataFlow:: TypeTracker:: end ( ) ) .flowsTo ( result ) }
402
411
403
412
/** An `ElementTree` instantiated directly. */
@@ -439,7 +448,9 @@ module Lxml {
439
448
440
449
/** A call to serialise xml to a string */
441
450
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
+ }
443
454
444
455
override DataFlow:: Node getAnInput ( ) {
445
456
result = [ this .getArg ( 0 ) , this .getArgByName ( "element_or_tree" ) ]
0 commit comments