ç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
|
||||
|
||||
s = specfile.SpecFile(sys.argv[1])
|
||||
n=s.getNodes(sys.argv[2])
|
||||
|
||||
if not n:
|
||||
sys.exit(1)
|
||||
|
||||
for node in n[0].childNodes:
|
||||
if node.nodeType == node.TEXT_NODE:
|
||||
print node.data
|
||||
else:
|
||||
print "Verilen node için metin yok"
|
||||
text = s.getFirstChildText(sys.argv[2])
|
||||
print text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user