copy and rename xml nodes

Joined
Feb 13, 2008
Messages
1
Reaction score
0
Hi, I have the following record structure in xml documents. My intention is to get <Metadata> nodes with value "dc.Title" on "name" attribute. Then I wanto to make a copy of the selected <Metadata> element, rename them to <MetadataNoDiacritics> (or mark them with an attribute for later retrieval) and append them back on its appropriate place on the tree structure.
I have tried with elementtree findall and I can retrieve the nodes I need but I can't rename them and append them back to the original structrue. Thanks for help.

<DirectoryMetadata>​
<FileSet>​
<FileName>1948\.pdf</FileName>​
<Description>​

<Metadata mode="accumulate" name="dc.Title"> Títle with diácritics</Metadata>​
<Metadata mode="accumulate" name="dc.Creator">Smith, Ronald</Metadata>​
<Metadata mode="accumulate" name="dc.Date">1949</Metadata>​
<Metadata mode="accumulate" name="dc.Relation^isPartOf">Journal </Metadata>​
</Description>​
<FileSet>​
<DirectoryMetadata>​
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top