çoğu durumda kullanacağımız yalnızca ilk erişilen node'un metinini
çekmek için bir fonksiyon eklendi.
This commit is contained in:
@@ -7,14 +7,7 @@ sys.path.append("..")
|
|||||||
import specfile
|
import specfile
|
||||||
|
|
||||||
s = specfile.SpecFile(sys.argv[1])
|
s = specfile.SpecFile(sys.argv[1])
|
||||||
n=s.getNodes(sys.argv[2])
|
|
||||||
|
|
||||||
if not n:
|
text = s.getFirstChildText(sys.argv[2])
|
||||||
sys.exit(1)
|
print text
|
||||||
|
|
||||||
for node in n[0].childNodes:
|
|
||||||
if node.nodeType == node.TEXT_NODE:
|
|
||||||
print node.data
|
|
||||||
else:
|
|
||||||
print "Verilen node için metin yok"
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user