[4suite] [amara]question about abs_path
G S
gshepherd181 at gmail.com
Wed Dec 6 11:05:37 MST 2006
Hi all,
I'm new to Amara and DOM and I'm having a little trouble so I was wondering
if someone could point me in the right direction. I'm using abs_path from
Amara to get an element's and then store it as an attribute of the element
itself, but I'm not sure the best way to go about it.
This is my first attempt, but this throws an error.
If anyone could point me in the right direction, I'd appreciate it.
Thanks,
Greg
###
import amara
from amara import binderytools
from amara import domtools
from Ft.Xml.Domlette import NonvalidatingReader
from Ft.Lib import Uri
file_uri = Uri.OsPathToUri('ch26.xml', attemptAbsolute=1)
doc = NonvalidatingReader.parseUri(file_uri)
for node in doc.documentElement.childNodes:
if node.nodeType == node.ELEMENT_NODE:
doc.node.createAttribute('path').value='domtools.abs_path(node)'
Attribute error: 'Ft.Xml.cDomlette.Document' object has no attribute 'node'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fourthought.com/pipermail/4suite/attachments/20061206/ac05d842/attachment.html
More information about the 4suite
mailing list