paulinho
03-15-2011, 05:03 PM
Hi!
I need some help trying to get siblings in an xml file, I have got the value of the element <name> and want to find the value of names siblings. The problem is that there are a lot of name elements, but since I have the specific value of name i Should be able to find its siblings, shouldn't I?
example of the xml-file that I am parsing:
<Layer queryable="0" opaque="0" cascaded="0">
<Name>na_drain_nam</Name>
<Title>River Names</Title>
<Abstract>Names of rivers in the North America region.</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
<BoundingBox SRS="EPSG:4326" minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
</Layer>
−
<Layer queryable="0" opaque="0" cascaded="0">
<Name>na_division_nam</Name>
<Title>Province, Territory, State Names</Title>
−
<Abstract>
Province, territory, and state names in the North America region.
</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
<BoundingBox SRS="EPSG:4326" minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
</Layer>
How or what function in javascript can I use to get the values for the siblings?
please help!
/Paul
I need some help trying to get siblings in an xml file, I have got the value of the element <name> and want to find the value of names siblings. The problem is that there are a lot of name elements, but since I have the specific value of name i Should be able to find its siblings, shouldn't I?
example of the xml-file that I am parsing:
<Layer queryable="0" opaque="0" cascaded="0">
<Name>na_drain_nam</Name>
<Title>River Names</Title>
<Abstract>Names of rivers in the North America region.</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
<BoundingBox SRS="EPSG:4326" minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
</Layer>
−
<Layer queryable="0" opaque="0" cascaded="0">
<Name>na_division_nam</Name>
<Title>Province, Territory, State Names</Title>
−
<Abstract>
Province, territory, and state names in the North America region.
</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
<BoundingBox SRS="EPSG:4326" minx="-180" miny="-4.94415" maxx="180" maxy="89.9992"/>
</Layer>
How or what function in javascript can I use to get the values for the siblings?
please help!
/Paul