i have a small problem i have xome xml with a cdata section. This CDATA section contains fragments of HTMl. I would like to extract some of the data inside this CDATA element. Right now i have a XSLT transformation that outputs the rest of the document as HTMl, but i need only a small part of the CDATA HTML, not the entire part – e.g. a my Title tag. How to do this?
Share
XSLT won’t read the CDATA section as anything other than text. You’ll need to pre-parse your data before handing it over to XSLT. You could use a preparsing script (written in Python, PHP, Perl, VB, whatever) and then do one of (but not limited to) the following:
CDATAtags and allow XSLT to handle the undesired content<title>tag to a XSLT accesible place outside theCDATAtagsor a cthulhu-inducing regex) get the desired value out of theCDATAsection, and pass the desired value as a parameter to XSLT