Re: parse xml

4 views
Skip to first unread message
Message has been deleted

Alex Gaynor

unread,
Oct 15, 2010, 1:45:33 PM10/15/10
to django-d...@googlegroups.com
On Fri, Oct 15, 2010 at 1:38 PM, kostia <kostya....@gmail.com> wrote:
> I have xml file:
> <?xml version="1.1" encoding="UTF-8"?>
> <root>
>        <n>50000</n>
> </root>
>
> I want to get the value of n (= 50000) inside my python program, I'm
> doing this:
>
> import xml.dom.minidom
> from xml.dom.minidom import Node
> doc = xml.dom.minidom.parseString("boolean_width.xml")
> n = doc.getElementsByTagName("root")[0].firstChild.nodeValue.strip()
> print n
>
> and it is failed. How to get the value? Please, help.
>
> --
> You received this message because you are subscribed to the Google Groups "Django developers" group.
> To post to this group, send email to django-d...@googlegroups.com.
> To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
>
>

Hi,

The django-developers mailing list is for discussion about the
development of Django itself, not discussion about development with
Django. For that you'd want django-users (or in this case probably
python-list, aka comp.lang.python).

Alex

--
"I disapprove of what you say, but I will defend to the death your
right to say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you
want" -- Me

Message has been deleted

Horst Gutmann

unread,
Oct 15, 2010, 3:40:48 PM10/15/10
to Django developers
I so hope this response was the result of some translation gone wrong.
If not, you shouldn't really expect anyone to answer your (highly off-
topic) question with that attitude...

On Oct 15, 7:56 pm, kostia <kostya.demc...@gmail.com> wrote:
> Give me the answer and do what you want.
>
> On Oct 15, 8:45 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
>
>
>
>
>
>
>
> > On Fri, Oct 15, 2010 at 1:38 PM, kostia <kostya.demc...@gmail.com> wrote:
> > > I have xml file:
> > > <?xml version="1.1" encoding="UTF-8"?>
> > > <root>
> > >        <n>50000</n>
> > > </root>
>
> > > I want to get the value of n (= 50000) inside my python program, I'm
> > > doing this:
>
> > > import xml.dom.minidom
> > > from xml.dom.minidom import Node
> > > doc = xml.dom.minidom.parseString("boolean_width.xml")
> > > n = doc.getElementsByTagName("root")[0].firstChild.nodeValue.strip()
> > > print n
>
> > > and it is failed. How to get the value? Please, help.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups "Django developers" group.
> > > To post to this group, send email to django-d...@googlegroups.com.
> > > To unsubscribe from this group, send email to django-develop...@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/django-developers?hl=en.
Reply all
Reply to author
Forward
0 new messages