Hi all,
On 10/09/2012 16:52, Werner wrote:
> Hi all,
>
> I am finally getting some time to get back into my project.
>
> Things work fine if I write a XML file with Amara 2 and read it again,
> but when I do the following I don't get the same result.
>
> doc = xmlexp.createXMLdoc()
> xmlu.addElementPlusValue(doc.wine, u"name", u"Querciabella")
Did some more searching/debugging and find that if after the above I
write things to a file and read it in again things work as expected.
I.e. doing this:
doc
<entity at 0x08EF2348: 1 children>
unicode(
doc.wine.name)
u"<amara.tree.element at 0x060CB970: name u'name', 0 namespaces, 0
attributes, 1 children>"
tFile = open('vinoxmltest', 'w')
doc.xml_write(lookup("xml-indent"), stream=tFile)
tFile.close()
xdoc = bindery.parse('vinoxmltest')
unicode(
doc.wine.name)
u"<amara.tree.element at 0x060CB970: name u'name', 0 namespaces, 0
attributes, 1 children>"
unicode(
xdoc.wine.name)
u'Goldwater Esslin'
Why is it working on "
xdoc.wine.name" but not on "
doc.wine.name", what
am I doing wrong or missing here.
Work around would be writing to a temp file and reading again, but I
really only want to do this if there is no other way.
Werner