Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
AManohar
Contributor II
Contributor II

Creating XML using tAdvanceFileOutputXML

Hi,

I'm trying to create a job to read a XML file and replace just two fields and copy the remaining fields as such and create another xml.

If I use tFileInputxml -> txmlmap -> tAdvanceFileOutputXML , I'm getting the xml generated but with the "<" replaced by "&lt;".

0695b00000SqCsGAAV.png

Is there a way to get the XML nodes without the "<" ">"

Labels (3)
3 Replies
Covid19
Creator
Creator

why are you using both components at the same time?

***tXMLMap and tAdvancedFileOutputXML do almost the same thing.

  1. do your mapping in tXMLMap--->output as document----> tFileOutputXML
  2. check the box "incoming record is a document"

To better understand the problem take a screenshot of the desired result and the tXMLMap settings

AManohar
Contributor II
Contributor II
Author

Hi,

 

I tried to replace with the tFileOutputXML but that doesn't seems to be working . If I check 'incoming record is a document' , getting invalid getdocument() something.

 

Tried to replace the txmlMap with normal tmap.

Attaching the input and the output recived.

 

0695b00000SqJzxAAF.png 

0695b00000SqK0HAAV.png 

0695b00000SqK0RAAV.png 

Input file:

<?xml version="1.0" encoding="utf-8"?>

<docload xmlns:hub="http://hub.salmat.com.au" xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns="http://hub.salmat.com.au" timestamp="2020-09-09T13:53:33" version="">

<AccountType>

<Account>TESTACC</Account>

<Type>SAMPLE</Type>

</AccountType>

<mainacc uuid="5995B2C6-AE5D-12EB-8529-0242AC130003">

<docid uuid="5995B2C6-AE5D-12EB-8529-0242AC130003">

<index name="1">

<field name="Key1">value1</field>

<field name="Key1_TimeStamp">2020-09-09T13:53:33+1000</field>

<field name="Key2">value1</field>

</index>

<detail>2680076476|A0648AC252994BEDBFB2B20FADB96E4C</detail>

</docid>

<proc1>column1</proc1>

<proc2>MULTI_column1</proc2>

<column1>

<Test>test Messages</Test>

<attachment shared="true" name="attachment1">a.pdf</attachment>

<attachment shared="true" name="attachment2">b.pdf</attachment>

</column1>

<column2>

<Test>test Messages</Test>

</column2>

</mainacc>

</docload>

 

 

Output received: <in output the tags are repeated if we use get node.>

<?xml version="1.0" encoding="ISO-8859-15"?>

 

<docload>

 <AccountType>&lt;AccountType&gt;

&lt;Account&gt;TESTACC&lt;/Account&gt;&lt;Type&gt;SAMPLE&lt;/Type&gt;&lt;/AccountType&gt;</AccountType>

 <mainacc uuid="5995B2C6-AE5D-12EB-8529-0242AC130003">

  <docid uuid="5995B2C6-AE5D-12EB-8529-0242AC130003">

   <index>&lt;index name="1"&gt;

&lt;field name="Key1"&gt;value1&lt;/field&gt;&lt;field name="Key1_TimeStamp"&gt;2020-09-09T13:53:33+1000&lt;/field&gt;&lt;field name="Key2"&gt;value1&lt;/field&gt;&lt;/index&gt;</index>

  </docid>

  <proc1>&lt;proc1&gt;column1&lt;/proc1&gt;</proc1>

  <proc2>&lt;proc2&gt;MULTI_column1&lt;/proc2&gt;</proc2>

  <column1>&lt;column1&gt;

&lt;Test&gt;test Messages&lt;/Test&gt;&lt;attachment shared="true" name="attachment1"&gt;a.pdf&lt;/attachment&gt;&lt;attachment shared="true" name="attachment2"&gt;b.pdf&lt;/attachment&gt;&lt;/column1&gt;</column1>

  <column2>&lt;column2&gt;

&lt;Test&gt;test Messages&lt;/Test&gt;&lt;/column2&gt;</column2>

 </mainacc>

</docload>

 

 

Thanks for your help.

AManohar
Contributor II
Contributor II
Author

Our requirement is to copy the whole xml to output, but change the uuid field alone.

<mainacc uuid="5995B2C6-AE5D-12EB-8529-0242AC130003">

<docid uuid="5995B2C6-AE5D-12EB-8529-0242AC130003">

 

mainacc will be the loop element. And we will have mutiple entries of the mainacc. for every record we need to change the uuid alone.