Skip to main content

Hello

I am having trouble extracting attributes from a kml for the features that have photos.

I am using XQuery similar to this example https://community.safe.com/s/question/0D54Q0000848CTkSAM/extracting-information-from-different-folders-in-kml-to-convert-to-the-shapefile

 

That method works for the features that don't have photos but the features that have photos seem to have a extra section in the HTML that is causing my XQuery to fail.

 

The Xquery I am using is :

 

declare default element namespace "http://www.w3.org/1999/xhtml";

for $x in /html/body/table/tr/td/table/tr

return fme:set-attribute($x/td/1]/text(),$x/td/2]/text())

 

I am pretty sure I just need to modify the Xquery

 

Hi @mapper​ 

 

Please, could you share a same data example?

 

 

Thanks in Advance,

Danilo


If you just want to ignore the parts with a link you could do something like this

declare default element namespace "http://www.w3.org/1999/xhtml";
 
let $values :=  /html/body/table/tr/td/table/tr
 
for $v in $values
let $attrname:= $v/tde1]bnot(a)]
let $attrval:=$v/tdo2]/text()
return fme:set-attribute($attrname,$attrval)

 

 


If you just want to ignore the parts with a link you could do something like this

declare default element namespace "http://www.w3.org/1999/xhtml";
 
let $values :=  /html/body/table/tr/td/table/tr
 
for $v in $values
let $attrname:= $v/tde1]bnot(a)]
let $attrval:=$v/tdo2]/text()
return fme:set-attribute($attrname,$attrval)

 

 

This worked perfectly! Thank you!


Reply