Skip to main content
Question

Add XML fragment using XMLUpdater

  • November 23, 2020
  • 0 replies
  • 14 views

Hi,

 

I have several XML files with the following content:

 <gmd:contact>

  <gmd:CI_ResponsibleParty>

   <gmd:organisationName xsi:type="gmd:PT_FreeText_PropertyType">

    <gco:CharacterString>Information in main language</gco:CharacterString>

    <gmd:PT_FreeText>

     <gmd:textGroup>

      <gmd:LocalisedCharacterString locale="#ENG">contact info in English</gmd:LocalisedCharacterString>

     </gmd:textGroup>

    </gmd:PT_FreeText>

   </gmd:organisationName>

  </gmd:CI_ResponsibleParty>

 </gmd:contact>

 

I will like to add contact in other language, for example:

 <gmd:contact>

  <gmd:CI_ResponsibleParty>

   <gmd:organisationName xsi:type="gmd:PT_FreeText_PropertyType">

    <gco:CharacterString>nformation in main language</gco:CharacterString>

    <gmd:PT_FreeText>

     <gmd:textGroup>

      <gmd:LocalisedCharacterString locale="#ENG">Contact info in English</gmd:LocalisedCharacterString>

     </gmd:textGroup>

     <gmd:textGroup>

      <gmd:LocalisedCharacterString locale="#FRE">Contact info in French</gmd:LocalisedCharacterString>

     </gmd:textGroup>

    </gmd:PT_FreeText>

   </gmd:organisationName>

 </gmd:CI_ResponsibleParty>

 </gmd:contact>

 

I am using an XMLUpdater with the following attributes:

  • Update type: Insert as last child
  • XML Path: //gmd:contact/gmd:CI_ResponsibleParty/gmd:organisationName/gmd:PT_FreeText/gmd:textGroup/gmd:LocalisedCharacterString
  • Value Type: XML/XQuery
  • Value: fme:get-attribute("text")

 

Using this values, I get the following result:

 <gmd:PT_FreeText>

     <gmd:textGroup>

      <gmd:LocalisedCharacterString locale="#ENG">Contact info in English Contact info in French</gmd:LocalisedCharacterString>

     </gmd:textGroup>

 

How do I have to do to get a new brach, not just the text added at the end of the previous text? How can I indicate the locale attribute?

 

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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.