Skip to main content
Archived

Improve XMLXQueryUpdater

Related products:Transformers
  • August 24, 2017
  • 1 reply
  • 3 views

takashi
Supporter

I recognized that the XMLXQueryUpdater can be used to update not only an XML document but also the schema of the input feature.

Example from Extract attributes from XML attribute:

Assuming that the source XML is:

<SHD>     <feature datadefinitie="Sleutels" code="SLEUTELS">         <attribuut naam="gisobjectnummeer">105963</attribuut>     </feature>     <feature datadefinitie="IMG" code="SHDV">         <attribuut naam="type">muur</attribuut>         <attribuut naam="IMGEO status">bestaand</attribuut>         <attribuut naam="In onderzoek">Nee</attribuut>         <attribuut naam="relatieveHoogteligging">0</attribuut>         <attribuut naam="identificatie">P0027.cdffbb11ae7c4f56a96a</attribuut>         <attribuut naam="tijadstipRegistratie">20170626172844000</attribuut>     </feature>     <feature datadefinitie="GBK_LKI" code="C"></feature> </SHD> 

An XMLXQueryUpdater with this small XQuery expression extracts pairs of attribute name and value from the source XML and adds the attributes to the input feature.

for $a in //attribuut return fme:set-attribute($a/@naam, $a/text()) 

I think the XMLXQueryUpdater (XQuery expressions) would be a powerful and elegant solution in some scenarios such as the example above. However, depending on the situation, you have to add some other transformers e.g. AttributeExposer, AttributeRemover to clean up the feature.

It might be nice if these improvements would be done on the XMLXQueryUpdater.

  • Add some new XQuery functions to process feature attributes. e.g. "fme:remove-attribute" and "fme:remove-list-attribute".
  • Add "Attributes to Expose", "Attributes to Hide", and "Lists to Hide" parameters.
  • Make the "Result Attribute" parameter optional.
  • Rename the output ports (QueryResults -> Output, Invalid -> <Rejected>).
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Supporter
  • Author
  • August 24, 2017
Ah, the XMLXQueryExtractor does the same thing and it has the Attributes to Expose parameter. It would be reasonable that the XMLXQueryUpdater would also have the same parameter for the same functionality.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings