Hi,
Since there are multiple <a> elements under an <element>, those attributes will be flattened as structured list, like this.
aspect.a{}.code
aspect.a{}.id
aspect.a{}.l
aspect.a{}.p
aspect.a{}.v
Takashi
This isn´t happening though. FME creates the field "xml_fragment" and basically inputs the whole xml file including the structural elements <, > / etc. I really don´t understand why this is happening! Any help would be appreciated.
If you specify "element" to Elements to Match parameter, "a" and its attributes will be stored in structured list as I mentioned in my previous post.
As long as seeing your image, I guess that you've specified "a" to Elements to Match.
Anyway, when using Feature Paths as configuration type, the XML reader adds "xml_fragment" to the reader feature type by default. This attribute stores an element matched with specified element (i.e. "a" in this case) as an XML document.
I think there are no problems, just ignore if you don't need it.
If you don't want to extract "xml_fragment" anyhow, consider using xfMap instead of Feature Paths.
Thanks....but in my case then, why is the following list element empty?
<a id="1" l="de" v="Alter Schafstall"/>
As I understand it, the element "v" which contains the text "Alter Schafstall" should be contained within the list a.v
Am I correct?
"a.v" is an attribute, is not a list attribute.
Yes, "a.v" of the first feature should contain "Alter Schafstall".
Connect an Inspector to the reader feature type and run the workspace. You can see how XML elements and attribute values are extracted.
OK...when I define "elements to match" as "a", then I obtain a table with the string "Alter Schaftstall" under element a.v! But when i the "element to match" is defined as element, then I expect aspect.a.v to include the string. Looking at the XML Document, Element is the parent, and "aspects" and "a" are children and "v" is the attribute. So why can´t I get the string when I define "elements"?
Because there are multiple <a> elements in an <elements> element. By default, the XML reader configures list attribute for multiple children which have same tag name.
Probably these list attributes occur in the reader feature type when you specify <elements> to Elements to Match.
element.aspects.a{}.v
element.aspects.a{}.p
and so on.
If this case, you will have to extract elements of the lists in the data flow after reading.
See here about lists.
http://docs.safe.com/fme/html/FME_Transformers/Default.htm#Categories/lists.htm%3FTocPath%3DFME%20Transformers%7CLists%7C_____0