[Tutor] Problem with BeautifulSoup
grouchy
grouch at gmail.com
Fri Sep 23 21:07:39 CEST 2005
Hi Bernard,
Not much of an answer, but I printed out your snippet with prettify() to
see how it was being parsed, and either the XML is funny, or Beautiful Soup
is :)
>>> from BeautifulSoup import BeautifulStoneSoup as BSS
>>> soup = BSS(xml)
>>> print soup.prettify()
<parameter scriptname="posx" fullname="Model.Camera_anim.kine.local.posx"
type="Parameter" sourceclassname="FCurve">
<fcurve plotted="False">
<parameters>
</parameters>
</fcurve>
</parameter>
<parameter scriptname="extrapolation">1
</parameter>
<parameter scriptname="interpolation">3
</parameter>
<parameter scriptname="highclamp">1.79769313486e+308
</parameter>
<parameter scriptname="locked">False
</parameter>
<parameter scriptname="lowclamp">-1.79769313486e+308
</parameter>
<parameter scriptname="nokeyvalue">7.64880829803
</parameter>
<parameter scriptname="si3dstyle">False
</parameter>
<parameter scriptname="type">20
</parameter>?
>>>
On 9/23/05, Bernard Lebel <3dbernard at gmail.com> wrote:
>
> Hello,
>
> I have this set of XML tags:
>
>
> <parameter scriptname="posx"
> fullname="Model.Camera_anim.kine.local.posx" type="Parameter"
> sourceclassname="FCurve">
> <fcurve plotted="False">
> <parameters>
> <parameter scriptname="extrapolation">1</parameter>
> <parameter scriptname="interpolation">3</parameter>
> <parameter scriptname="highclamp">1.79769313486e+308</parameter>
> <parameter scriptname="locked">False</parameter>
> <parameter scriptname="lowclamp">-1.79769313486e+308</parameter>
> <parameter scriptname="nokeyvalue">7.64880829803</parameter>
> <parameter scriptname="si3dstyle">False</parameter>
> <parameter scriptname="type">20</parameter>
> </parameters>
> </fcurve>
> </parameter>
>
>
> This set of tags is nested deep few levels of tags. When I get the
> fcurve tag, all I get is an empty tag. ie:
>
>
> oXMLFcurve = oXMLParameter.fcurve
> print str(oXMLFcurve)
>
>
> Outputs:
>
>
> <fcurve plotted="False">
> </fcurve>
>
>
> Normally it would print all the content of the tag, but it's not....
> Any suggestion or pointer would be welcome!
>
>
> Thanks
> Bernard
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050923/f9eb6374/attachment.html
More information about the Tutor
mailing list