cdata-section-elements collisions

Tuesday, 29 November 2011 · 3 messages · last reply 4 Dec 2011
J
jidanni29 Nov 2011 04:07 #
declare option output:cdata-section-elements "description"; works great, except that I want it to work only on my //Folder/description's not my //Placemark/description's. I read http://www.w3.org/TR/2010/REC-xslt-xquery-serialization-20101214/index.html#XML_CDATA-SECTION-ELEMENTS and http://docs.basex.org/wiki/Serialization and no matter what I do...
CG
Christian Grün29 Nov 2011 04:17 #
Quoted text · jidanni · 7 lines
> declare option output:cdata-section-elements "description"; > works great, except that I want it to work only on my > //Folder/description's not my > //Placemark/description's. > I read > http://www.w3.org/TR/2010/REC-xslt-xquery-serialization-20101214/index.html#XML_CDATA-SECTION-ELEMENTS > and http://docs.basex.org/wiki/Serialization and no matter what I do...
AFAIK, there is no way to do this, as the "cdata-section-elements" option is only defined for QNames, but not for document paths. This is probably because the serializer has no idea which path a serialized element originally belonged to.
J
jidanni4 Dec 2011 10:30 #
Another mystery is how to give more than one. http://www.w3.org/TR/xslt-xquery-serialization/#XML_CDATA-SECTION-ELEMENTS says "The cdata-section-elements parameter contains a list of expanded QNames." Lo and behold http://docs.basex.org/wiki/Serialization reveals how this is done... separated by whitespace! E.g., declare option output:cdata-section-elements "names addresses"; Which one would never have guessed from the W3 document. P.S., maybe change all those = in the http://docs.basex.org/wiki/Serialization examples... OK, I guess so far I've only used them in the prolog...

⚡Generated with XQuery