Skip to main content

 

Been trying to get this working for a while, but I have to surrender...

 

My XML:

<?xml version="1.0" encoding="UTF-16"?>
<Surface name="Zone 101_01.01_A_020!" desc="" xmlns="http://www.landxml.org/schema/LandXML-1.2">
<SourceData/>
<Definition surfType="TIN" area2DSurf="234921.542328654672" area3DSurf="238197.012906672346" elevMax="11.943587904916" elevMin="-3.839199295337">
<Pnts>
<P id="2">214609.472108227172 150506.362479594914 5.162708941504</P>
</Pnts>
</Definition>
</Surface>

The attribute I need is "Zone 101_01.01_A_020!".

 

Queries I tried:

/Surface/@name/string()
for $c in /Surface
return data($c/@name)
/Surface/@name

When I test in online extractors, it does work. When I remove the namespace it starts to work, but why?

I'm using FME Desktop 2021.2.6

Can someone please help?

declare namespace x='http://www.landxml.org/schema/LandXML-1.2';
/x:Surface/@name/string()

 image


declare namespace x='http://www.landxml.org/schema/LandXML-1.2';
/x:Surface/@name/string()

 image

thanks!


thanks!

Lesson learned, take more time to read the documentation more carefully, as it is described in the first example. 😅

 

Since the top-level node contains the namespace declaration 'xmlns', the namespace must be declared in the query and it must be used to specify every element.


Reply