Question

no valid xml to excel

  • 12 December 2016
  • 6 replies
  • 7 views

Badge

Hi,

I have a xml document (someName.conf) which is not valid.

like:

<?xml version="1.0" encoding="ISO-8859-1"?>

 

<application name="....">

 

<component name="....">

 

<setting>

 

<!--

 

any comment

 

-->

 

<name>Explorer.Service</name>

 

<value></value>

 

<enabled>false</enabled>

 

</setting>

 

<setting>

.... and so on

I have no xfmaps or other schemas.

I used different readers (generic and xml) and used some transformers like xmlFlattener but can't find to extract xml element/item with attribute.

output excel file should look like

column a -> comment

column b -> name

column c -> value

column d -> enabled

I`m using FME Desktop 2015.1

Any hint? thanks


6 replies

Userlevel 5
Badge +25

If the XML is not valid there's a big chance FME won't be able to read it either. You can try this:

Create an XML reader, go into its parameters, set the Configuration Type to Feature Paths, find the Elements To Match setting and set that to setting, then enable flattening in the Flatten Options.

That way FME will try and make attributes out of everything it can find underneath that <setting> tag and you can map it to Excel.

Hope this helps.

Badge

If the XML is not valid there's a big chance FME won't be able to read it either. You can try this:

Create an XML reader, go into its parameters, set the Configuration Type to Feature Paths, find the Elements To Match setting and set that to setting, then enable flattening in the Flatten Options.

That way FME will try and make attributes out of everything it can find underneath that <setting> tag and you can map it to Excel.

Hope this helps.

Thanks for your hint. I will try this and let you know. :-)

Badge

I can transform my xml document ("elements to match" did the trick) to excel but comments are missing.

I will try different settings at reader level to export comments to excel too.

Thank you.

Badge +16

If it's possible upgrade to 2016 that will provide you with a feature introduced in 2016 that scans the schema and returns all the xml elements in the input.

Hope this helps

Badge

If it's possible upgrade to 2016 that will provide you with a feature introduced in 2016 that scans the schema and returns all the xml elements in the input.

Hope this helps

@itay do you mean that xml reader has a new feature in version 2016? Or is this a completely new reader? Do this read my comments by default or at least easier than in 2015?

Badge +16

If it's possible upgrade to 2016 that will provide you with a feature introduced in 2016 that scans the schema and returns all the xml elements in the input.

Hope this helps

@nhaz Its a new 2016 XML reader functionality, see the following article for more info

Reply