Hi @dchow,
FME doesn't have a transformer to extract the table data from HTML, but it does have a reader that can. So you can write the kml_description attribute to a temporary file, then read it back in through a FeatureReader:
I have attached the workspace snippet for you. It could be wrapped up in a custom transformer if there is enough interest. The folder created by the TempPathnameCreator is automatically cleaned up when the workspace finishes.
Hi @dchow,
FME doesn't have a transformer to extract the table data from HTML, but it does have a reader that can. So you can write the kml_description attribute to a temporary file, then read it back in through a FeatureReader:
I have attached the workspace snippet for you. It could be wrapped up in a custom transformer if there is enough interest. The folder created by the TempPathnameCreator is automatically cleaned up when the workspace finishes.
Hi @daveatsafe
When I run the workflow at the FeatureReader I get an error "HTML Table Reader: No lists or tables were found in the HTML document".
Hi @daveatsafe
When I run the workflow at the FeatureReader I get an error "HTML Table Reader: No lists or tables were found in the HTML document".
Because the temporary folder lasts only as long as the workspace is running, I don't think this workspace will work properly with Feature Caching. Please use Run - Run Entire Workspace to run the full workspace every time.
Hi @daveatsafe
When I run the workflow at the FeatureReader I get an error "HTML Table Reader: No lists or tables were found in the HTML document".
Hi @daveatsafe
Is there an email I can send the data to you with to test with. I've ran it using Run Entire Workspace but I am not getting attributes in the the fields that were exposed.
Hi @daveatsafe
When I run the workflow at the FeatureReader I get an error "HTML Table Reader: No lists or tables were found in the HTML document".
Sure, please send the data to dave.campanas@safe.com.
You could look at using a HTML extractor to get the table information, if the table is always in the same format
You could also use the method described here
https://community.safe.com/s/article/how-to-expose-feature-attributes-from-kml-tag
with the following xquery
declare default element namespace "http://www.w3.org/1999/xhtml";
for $x in /html/body/table/tr
return {
if ($x/tdr1] ne '') then fme:set-attribute($x/tde1]/text(),$x/tdi2]/text())
else ()
}
You could also use the method described here
https://community.safe.com/s/article/how-to-expose-feature-attributes-from-kml-tag
with the following xquery
declare default element namespace "http://www.w3.org/1999/xhtml";
for $x in /html/body/table/tr
return {
if ($x/tdr1] ne '') then fme:set-attribute($x/tde1]/text(),$x/tdi2]/text())
else ()
}
Hi @ebygomm ,
Those are great examples, I worked with Dave and we figured out a solution using the above workspace, the data had a mix of tables in the description.
But I will keep these examples and try them out.
Thanks