BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help translating Python code to Delphi

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML
View previous topic :: View next topic  
Author Message
Junior/RO
Guest





PostPosted: Sun Jan 15, 2006 10:17 am    Post subject: Help translating Python code to Delphi Reply with quote



Hi, I need help to translate this Python code to Delphi (to read a xml file), but don't know which classes/libraries to use:


import xml.dom.minidom

dom = xml.dom.minidom.parseString(s)

file = dom.getElementsByTagName("file")[0]
fname = file.getAttribute("name")

createinfo = dom.getElementsByTagName("created_as")[0]
created_as = createinfo.getAttribute("original_name")

creator = createinfo.getElementsByTagName("patch")[0]
creator_hash = creator.getAttribute("hash")

mod = dom.getElementsByTagName("modified")[0]
lastpatch = mod.getElementsByTagName("patch")[0]
lastchange_hash = lastpatch.getAttribute("hash")
lastchange_author = lastpatch.getAttribute("author")

--
Junior/RO
Back to top
Junior/RO
Guest





PostPosted: Sun Jan 15, 2006 2:41 pm    Post subject: Re: Help translating Python code to Delphi Reply with quote



Junior/RO escreveu:

Quote:
Hi, I need help to translate this Python code to Delphi (to read a xml file), but don't know which classes/libraries to use:

additional info:

identifiers fname, created_as, creator_hash, lastchange_hash, lastchange_author are strings

the others idents I don't know which is the appropriate type

sorry by the bad english and thanks in advance Surprised)

--
Não tá morto quem luta e quem peleia.

Junior/RO

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi XML All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.