On 8/31/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
> Hi Travis,
Hey Danny,
> Putting pure binary bytes in an XML file has a flaw: the issue is that the
> binary bytes themselves might contain characters that could be interpreted
> as XML! Even if we wrap the content in CDATA, there's nothing that
> > One snag that I found is that the des encryption that I used for the
> > data that is written back, it is not parsed correctly when the file is
> > read again with the new data in it. There is non-printable characters
> > or non-ascii chars in that gives errors from expat when the contents
> >
On 8/30/05, Johan Geldenhuys <[EMAIL PROTECTED]> wrote:
> One snag that I found is that the des encryption that I used for the data
> that is
> written back, it is not parsed correctly when the file is read again with the
> new
> data in it. There is non-printable characters or non-ascii chars
Kent,
Thanks for the tip. I can write the changed data back to my xml file. One snag that I found is that the des encryption that I used for the data that is written back, it is not parsed correctly when the file is read again with the new data in it. There is non-printable characters or non-as
Johan Geldenhuys wrote:
> That means that I have to compile the whole file from scratch in Python,
> minidom.
> I am not that good, yet, but will try.
No, not if I understand what you are trying to do - the xmlDocument you have is
all the data from the file, just write it back out using the code
That means that I have to compile the whole file from scratch in Python, minidom.
I am not that good, yet, but will try.
will it be easier to search for the string that I look for in the file (readlines) and then just write the pieces back again?
Johan
On Tue, 2005-08-30 at 07:40 -0400, Kent J
Johan Geldenhuys wrote:
> Thanks for he help, so far.
>
> I am still having some questions on writing my new string back to the
> xml file after I found what I was looking for and changed it.
>
> Extracts:
>
> xmlDocument = minidom.parse(file_name) # open existing file for parsing
> main = xmlD
Thanks for he help, so far.
I am still having some questions on writing my new string back to the xml file after I found what I was looking for and changed it.
Extracts:
xmlDocument = minidom.parse(file_name) # open existing file for parsing
main = xmlDocument.getElementsByTagName('Config')
> """ Parse the xml file """
> xmlDocument = minidom.parse(self.configFile)
[code cut]
> Now I want to change a string that a retrieved from the file and write
> it back to where it was. So, I get something, change it and write it
> back.
>
> How do I put the new string in the place
Hi all,
I use minidom to parse xml data from a file.
I know how to get the data:
"""
""" Parse the xml file """
xmlDocument = minidom.parse(self.configFile)
""" Parse xml main section """
mainSection = xmlDocument.getElementsByTagName('Config')
"
10 matches
Mail list logo