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: 
slupdike
Contributor II
Contributor II

Drop some XML records from a file

Hello, I am trying to use CRC to winnow down an XML file to only records that are new or have changed since the last ingest.  I am using tFileInputXML to pull the "primary key" (RefId / attribute) and the top level of the individual XML records.  This is workling.  I end up with the RefId, a field that holds the entire XML record for that person, and by sending the flow into a tAddCRCRow, a CRC for each record.  In the next step, I want to take this file and drop some of the records (based on my CRC processing) and re-assemble the records that are left back into a valid XML file.  Basically, if I GET 1000 records, and only 2 have changed since the last time a I ingested these records, i only want to send the 2 changed records on for all of the additional processing.  I have tried using the XML output components, but I think because I already have the XML tags in the file, the component can't handle it.  Does anyone know if if there is a way to do this, or do I have to break the XML into a flat file, remove the records I want to delete, and re-map everything back into the XML structure.  Thanks!

Labels (3)
1 Solution

Accepted Solutions
slupdike
Contributor II
Contributor II
Author

I finally got it to work by using treating the XML file as a delimited text file and using tReplace to correct the XML. 

View solution in original post

3 Replies
Anonymous
Not applicable

Hello,

Could you please elaborate your case with an example with input and expected output values?

Best regards

Sabrina

slupdike
Contributor II
Contributor II
Author

I finally got it to work by using treating the XML file as a delimited text file and using tReplace to correct the XML. 

Anonymous
Not applicable

Hello,

Great you got it to work. Thanks for sharing your solution with us.

Best regards

Sabrina