Skip to main content

The 'Update Type' etc. required in the XMLUpdater is different depending on whether the XML tag already exists or not ('Replace Contents' or 'Insert' respectively). This makes it very awkward to deal with XML of unknown completeness.

There should be a way to create a tag , including all the hierarchy above it, if the tag doesn't exist and just 'Replace Contents' if the tag does already exist.

e.g.

Update TypeXML PathValue TypeValue
Insert or Replace Contents/metadata/dataIdInfo/idCitation/date/reviseDateXML/XQueryfme:get-attribute("_timestamp")

...should generate...

<metadataxml:lang="en">    <dataIdInfo>       <idCitation>          <date>             <reviseDate>20161116</reviseDate>          </date>       </idCitation>    </dataIdInfo> </metadata> 

...whether the starting document was


<metadataxml:lang="en"> </metadata>

or

<metadataxml:lang="en">   <dataIdInfo>      <idCitation>         <date>            <reviseDate>Yesterday</reviseDate>         </date>      </idCitation>   </dataIdInfo> </metadata>

Be the first to reply!