[PD] parsing XML

Jack jack at rybn.org
Tue Jun 11 17:46:53 CEST 2013


Le 11/06/2013 13:56, Iain Mott a écrit :
> Hi list,
>
> I have a "string2any" object which is outputting XML that mostly looks
> like this when sent to a print object:
>
> print: <update><source id='1' level='-86.6183'/></update>
> print: <update><source id='1' level='-87.9314'/></update>
> print: <update><source id='1' level='-85.5559'/></update>
> print: <update><source id='1' level='-83.4277'/></update>
> print: <update><source id='1' level='-83.5981'/></update>
>
> etc.
>
> My patch doesn't need this information, only 'position' information, and
> when something important happens, data with x and y coordinates is
> outputted by string2any like this:
>
>
> print: <update><source id='1'><position x='1.19286'
> y='0.992857'/></source></update>
>  
> My patch needs to extract the x and y values as floats.
>
> I'm a bit rusty with Pd and I've not been able to work out how to do
> this. Can anyone please suggest what externals/techniques to use?
>
> Thanks!
>
> Iain
>
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Maybe, something like that could help ?
(patch attached to this mail).
++

Jack


-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_float_in_string.pd
Type: application/puredata
Size: 554 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20130611/78d3aa46/attachment.bin>


More information about the Pd-list mailing list