用法:
expandNode(node)
将
node
的所有子级扩展为node
。例子:from xml.dom import pulldom xml = '<html><title>Foo</title> <p>Some text <div>and more</div></p> </html>' doc = pulldom.parseString(xml) for event, node in doc: if event == pulldom.START_ELEMENT and node.tagName == 'p': # Following statement only prints '<p/>' print(node.toxml()) doc.expandNode(node) # Following statement prints node with all its children '<p>Some text <div>and more</div></p>' print(node.toxml())
相关用法
- Python xml.etree.ElementTree.XMLParser用法及代码示例
- Python xml.etree.ElementTree.Element用法及代码示例
- Python xml.parsers.expat.ExpatError.code用法及代码示例
- Python xml.parsers.expat.ParserCreate用法及代码示例
- Python xml.etree.ElementTree.canonicalize用法及代码示例
- Python xdrlib.Packer.pack_list用法及代码示例
- Python torch.distributed.rpc.rpc_async用法及代码示例
- Python torch.nn.InstanceNorm3d用法及代码示例
- Python sklearn.cluster.MiniBatchKMeans用法及代码示例
- Python pandas.arrays.IntervalArray.is_empty用法及代码示例
- Python tf.compat.v1.distributions.Multinomial.stddev用法及代码示例
- Python numpy.less()用法及代码示例
- Python tf.compat.v1.distribute.MirroredStrategy.experimental_distribute_dataset用法及代码示例
- Python Sympy Permutation.list()用法及代码示例
- Python dask.dataframe.Series.apply用法及代码示例
- Python scipy.ndimage.binary_opening用法及代码示例
- Python pyspark.pandas.Series.dropna用法及代码示例
- Python torchaudio.transforms.Fade用法及代码示例
- Python dask.dataframe.to_records用法及代码示例
- Python pyspark.pandas.groupby.SeriesGroupBy.unique用法及代码示例
注:本文由纯净天空筛选整理自python.org大神的英文原创作品 xml.dom.pulldom.DOMEventStream.expandNode。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。