comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » read XML with IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
read XML with IDL [message #71672] Wed, 14 July 2010 02:59 Go to previous message
sh is currently offline  sh
Messages: 26
Registered: April 2010
Junior Member
Hello together,

I already searched in the archive, but I didn't find a clear answer.

Every time you want to read .xml files, you have to write your own
parser (e.g. .edit xml_to_struct__define.pro) right?

But is there a possibilty to build up a struct automatically? E.g. the
input .xml file

<Solar_System>
<Planet NAME='Mercury'>
<Orbit UNITS='kilometers' TYPE='ulong64'>579100000</Orbit>
<Period UNITS='days' TYPE='float'>87.97</Period>
<Satellites TYPE='int'>0</Satellites>
</Planet>
...
</Solar_System>

output in IDL (structs within a "main" struct) the name of struct and
tags depends on the name of elements and the attributes

solar_system={solar_system,planet:{planet,orbit:
{orbit,units:'kilometers',type:'ulong64',value:'579100000'}, period:
{period,units:'days',type:'float',value:'87.97'},satellites:
{satellites,type:'int',value:'0'}}}

print, solar_system.planet.orbit
{ kilometers ulong64 579100000}

print, solar_system.planet.orbit.value
579100000


My questions are now: Should I write my own parser? Should I wait for
IDL8, maybe there are more adv. features for XML? Or does someone have
already such a routine?

thanks,
Sebastian
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to allocate memory for an array of more than 2G
Next Topic: for loop isn't working

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 15:48:42 PDT 2025

Total time taken to generate the page: 1.59898 seconds