Re: [xsl] Retrieving "markup" hidden in comments

Subject: Re: [xsl] Retrieving "markup" hidden in comments
From: Abel Braaksma <>
Date: Thu, 28 Jun 2007 17:46:02 +0200
Hi Bruce,

AAS Contractor wrote:
My problem is:
I have xml files which contain Arbortext Math markup which has been placed in comments, e.g.

<snip />

I can retrieve the comment text string, but of course that's all it is - a string. Is there any way to coerce that into being treated as an element or document-node?

<snip />

Is there a way to emulate the effect of document() but on the content of a variable rather than a file?

what you probably want is something like saxon:parse (, which takes a string and parses it as XML. Note that this is an XSLT extension from Saxon and as such will not work on other processors.

Maybe somewhere out there someone has created a pure XSLT solution for parsing text as XML (can be done, but I have no idea how easy / hard it would be).

-- Abel

Current Thread