Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Merge XML documents

Avatar

Level 8
Level 8
Hi all,



I have a list of XML documents (from a number of barcodes) and I need to merge them into one xml document.



How can I achieve this?



I have tried the concat-function - but I get an error telling me:



org.xml.sax.SAXParseException: Content is not allowed in prolog.



What can I do?



Sincerely

Kim
1 Reply

Avatar

Level 9
Try converting them to strings (using xpath serialize function), concatenating them together (using xpath concat function), and then turning the result back into xml using the serialize function.

Howard

http://www.avoka.com