Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

The use of serialize

Avatar

Level 8
Level 8
Hi all,



I am trying to use the serialize xpath function to serialize an xml variable to a string, but nothing is stored in the string:



/process_data/myString = serialize(/process_data/myXmlVar/*, true())



What am I doing wrong?



Thanks in advance.



Sincerely

Kim
3 Replies

Avatar

Level 10
Try the following:



/process_data/myString = serialize(/process_data/myXmlVar/*)



Jasmin

Avatar

Former Community Member
Do you need the /*? I think I've serialized an XML document without it.



Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com

Avatar

Level 10
Yes you can. It just depends what xml you want to serialize. The serialize function doesn't care as long as it's valid xml.



Jasmin