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

Home » Public Forums » archive » Re: Another XML Question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Another XML Question [message #43072 is a reply to message #43066] Tue, 22 March 2005 19:52 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Michael Wallace writes:

> So, when you say there's an "end of line string" or something in there,
> what exactly are you talking about? I'm just curious what kind of
> gremlin or banshee you're dealing with.

Well, here is my XML file:

<CONFIGDATA>
<CAMPAIGN_ID>
<TYPE>INT</TYPE>
<VALUE>00</VALUE>
</CAMPAIGN_ID>
<SPAM_WAIT>
<TYPE>INT</TYPE>
<VALUE>60</VALUE>
<UNITS>Seconds</UNITS>
</SPAM_WAIT>
</CONFIGDATA >

Here is my code:

doc = Obj_New('IDLffXMLDOMDocument')
doc -> Load, Filename=filename, /Exclude_Ignorable_Whitespace

tags = doc -> GetElementsByTagName('CONFIGDATA')
node = tags -> Item(0)
children = node -> GetChildNodes()
FOR j=0,children->GetLength()-1 DO BEGIN
child = children -> Item(j)
Help, child
ENDFOR

And here is the result:

CHILD OBJREF = <ObjHeapVar43440(IDLFFXMLDOMTEXT)>
CHILD OBJREF = <ObjHeapVar43443(IDLFFXMLDOMELEMENT)>
CHILD OBJREF = <ObjHeapVar43445(IDLFFXMLDOMTEXT)>
CHILD OBJREF = <ObjHeapVar43447(IDLFFXMLDOMELEMENT)>
CHILD OBJREF = <ObjHeapVar43449(IDLFFXMLDOMTEXT)>

Only child 2 and 4 are the elements I'm looking for: CAMPAIGN_ID
and SPAM_WAIT. The other three children are some kind of white
space thingy. If I get the value of the TEXT objects, I see a single
quote on one line and a single quote on the next line. No text.

If I get the children of the CAMPAIGN_ID element, there are 9 of
them, and only 3 I care about.

Go figure!

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: LINUX Device Question
Next Topic: Re: LINUX Device Question

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

Current Time: Wed Dec 03 02:28:54 PST 2025

Total time taken to generate the page: 0.32313 seconds