Skip to main content

Hi,

Quick question: I have a attribute containing a larger xml file. I need the text of one element as a new attribute. It's two levels deep. I tried messing around with the flattner but I can't get it to work.

Within the root, it looks like this:

<BG:gelijk StUF:entiteittype="NPS">

 

<BG:inp.bsn>*VALUE I NEED*</BG:inp.bsn>

 

</BG:gelijk>

Can someone help me out? Thanks!

Hi @mvdorst, the XMLFlattener should work to extract the value of the <inp.bsn> element with these parameters.

  • Elements to Match: inp.bsn
  • Attributes to Expose: inp.bsn

However, it requires a premise that the XML namespaces (BG, StUF) are declared properly in the source XML document.


I forget the expose part, thanks! What if I would want expose whatever is in

<BG:gelijk StUF:entiteittype="NPS">

with the name of inside element as attribute name, and the text as value. Is this possible? If not no problem, there are only a finite ammount of options, but it would save me manually check for each.


I forget the expose part, thanks! What if I would want expose whatever is in

<BG:gelijk StUF:entiteittype="NPS">

with the name of inside element as attribute name, and the text as value. Is this possible? If not no problem, there are only a finite ammount of options, but it would save me manually check for each.

Exposing attribute name is optional, and it's necessary only if you need to refer to the attribute in the subsequent transformers or writer feature types when creating the workspace.

 

 

Would you like to use "NPS" as the name of attribute that stores "*VALUE I NEED*"?

 

If so, a possible way is to use the XMLXQueryExtractor.

 

 


Reply