comparison markup/path.py @ 37:224b0b41d1da

Moved some of the tests for the strip directive to a new unittest test case to not clutter up the documentation.
author cmlenz
date Sun, 02 Jul 2006 23:10:27 +0000
parents 0e1fc0211416
children fec9f4897415
comparison
equal deleted inserted replaced
36:57d607f25484 37:224b0b41d1da
97 97
98 If there are no matches, this method returns an empty stream. 98 If there are no matches, this method returns an empty stream.
99 99
100 >>> from markup.input import XML 100 >>> from markup.input import XML
101 >>> xml = XML('<root><elem><child>Text</child></elem></root>') 101 >>> xml = XML('<root><elem><child>Text</child></elem></root>')
102
102 >>> print Path('child').select(xml) 103 >>> print Path('child').select(xml)
103 <child>Text</child> 104 <child>Text</child>
104 105
105 >>> xpath = Path('child')
106 >>> print Path('child/text()').select(xml) 106 >>> print Path('child/text()').select(xml)
107 Text 107 Text
108 108
109 @param stream: the stream to select from 109 @param stream: the stream to select from
110 @return: the substream matching the path, or an empty stream 110 @return: the substream matching the path, or an empty stream
Copyright (C) 2012-2017 Edgewall Software