Thanks to both Mike and Abel for providing the answer. That extension had
passed me by. I think such a function could be a useful addition to the
spec.
cheers,
Bruce
"Michael Kay" <mike(_at_)saxonica(_dot_)com>
28/06/2007 16:50
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
cc
Subject
RE: [xsl] Retrieving "markup" hidden in comments
The saxon:parse() extension function allows you to extract the content of
the comment and parse it as if it were an XML document.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: AAS Contractor [mailto:AAS(_dot_)Contractor(_at_)iop(_dot_)org]
Sent: 28 June 2007 16:38
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Retrieving "markup" hidden in comments
Hi,
I'm using XSLT 2.0 with Saxon 8B.
My problem is:
I have xml files which contain Arbortext Math markup which
has been placed
in comments, e.g.
<!--<FORMULA><F>-21.6&lt;M<INF>V</INF>&lt;-14.9</F></F
ORMULA>-->
The reason being that the math markup is not valid according
to the DTD being used. I have no control over this. However,
I want to be able to process this "hidden" markup as if it
were real elements.
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? I can achieve the effect I want
by writing the content of each comment out to a file (using a
character map or
disable-output-escaping) and read them in again on a second
pass. This works, but is rather messy, and I'd rather do it
in one pass.
Is there a way to emulate the effect of document() but on the
content of a
variable rather than a file? Other than that, I guess the
other option is to write a parser for the math markup in
xslt, which I'd rather not have to do :-(
Thanks for any suggestions.
Regards,
Bruce
**************************************************************
**********
This email (and attachments) are confidential and intended
for the addressee(s) only. If you are not the intended
recipient please notify the sender, delete any copies and do
not take action in reliance on it. Any views expressed are
the author's and do not represent those of IOP, except where
specifically stated. IOP takes reasonable precautions to
protect against viruses but accepts no responsibility for
loss or damage arising from virus infection. For the
protection of IOP's systems and staff emails are scanned
automatically.
IOP Publishing Limited Registered in England under
Registration No 467514. Registered Office: Dirac House,
Temple Back, Bristol BS1 6BE England Vat No GB 461 6000 84.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--