Re: newby question : parse xml file



"EF" <felad@xxxxxxxxx> wrote:

Hi

I have xml file that look like that
<entities>
<Comp id="123">
<Description max_length="" reference_to=""
type="multiline_string"/>
<Clone max_length="" reference_to="Comp"
type="reference_list">
<Comp id="129" />
</Clone>
</Comp>
<Comp id="124">
<Description max_length="" reference_to=""
type="multiline_string"/>
</Comp>
</entities>

I need a way to get the Comp id numbers that are only on the top level
( under entities )
and not in all xml file.

Alternative solution, using XML::Parser:

http://johnbokma.com/perl/element-id-for-given-parent.html


--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
.



Relevant Pages

  • Re: newby question : parse xml file
    ... and not in all xml file. ... One way to handle this is to set a flag to some OK value in the start handler section that handles entities elements, then in the section of the start handler that handles Comp elements, do what you need to do iff the flag is OK, then set it to a not OK value. ...
    (comp.lang.perl.misc)
  • referencing external xml file
    ... then 1.html has a hyperlink in it somewhere that points to ... content of one xml file into another xml file. ... Any advice on this, or an alternative solution, greatly appreciated. ... Prev by Date: ...
    (comp.text.xml)