removing parent nodes based on child node attribute or value
Posted: Wed Jan 18, 2023 11:13 pm
Hello, newbie question here.
I have multiple nodes with this structure:
Trying to remove all other similar Placemanrk nodes that don't have that SimpleData child node (with STATE attribute), that has a value of "30".
Tried this with the refactor tool (delete element), but it comes back with "No resources were affected":
Placemark[not(ExtendedData/SchemaData/SimpleData/text() = '30')]
Any advice is appreciated.
Thank you!
I have multiple nodes with this structure:
Code: Select all
<Placemark>
<name>State House District 22</name>
<Style>
<LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle>
</Style>
<ExtendedData>
<SchemaData schemaUrl="#State_Legislative_Districts_Lower_Houses">
<SimpleData name="OBJECTID">1</SimpleData>
<SimpleData name="AREALAND">297416805</SimpleData>
<SimpleData name="AREAWATER">1125626</SimpleData>
<SimpleData name="BASENAME">22</SimpleData>
<SimpleData name="CENTLAT">+47.6078421</SimpleData>
<SimpleData name="CENTLON">-111.4695096</SimpleData>
<SimpleData name="FUNCSTAT">N</SimpleData>
<SimpleData name="GEOID">30022</SimpleData>
<SimpleData name="INTPTLAT">+47.6063469</SimpleData>
<SimpleData name="INTPTLON">-111.4675708</SimpleData>
<SimpleData name="LDTYP">O</SimpleData>
<SimpleData name="LSADC">LL</SimpleData>
<SimpleData name="LSY">2022</SimpleData>
<SimpleData name="MTFCC">G5220</SimpleData>
<SimpleData name="OID">2.13903180861662e+15</SimpleData>
<SimpleData name="SLDL">022</SimpleData>
<SimpleData name="STATE">30</SimpleData>
<SimpleData name="SHAPE_Length">1.07988045909769</SimpleData>
<SimpleData name="SHAPE_Area">0.0357120795919999</SimpleData>
</SchemaData>
</ExtendedData>
<MultiGeometry>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates></coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
</MultiGeometry>
</Placemark>
<Placemark>
Tried this with the refactor tool (delete element), but it comes back with "No resources were affected":
Placemark[not(ExtendedData/SchemaData/SimpleData/text() = '30')]
Any advice is appreciated.
Thank you!