Subject: Re: [xsl] How to Parse String with Escaped XML Markup? From: "David Carlisle d.p.carlisle@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 15 Jan 2021 15:20:17 -0000 |
so xml <x> <?oxy_delete author="ekimber" timestamp="20210115T085216-0600" content="<body><p><ul id="ul_c5k_mhh_34b"><li>li one</li><li>li two</li></ul></p></body>"?> </x> xsl <xsl:stylesheet version="3.0" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform"> <xsl:template match="processing-instruction()"> <xsl:message select="parse-xml(parse-xml(concat('<x ',.,'/>'))/x/@content)"/> </xsl:template> </xsl:stylesheet> saxon: $ saxon ek1.xml e1.xsl <body><p><ul id="ul_c5k_mhh_34b"><li>li one</li><li>li two</li></ul></p></body> On Fri, 15 Jan 2021 at 14:57, Eliot Kimber ekimber@xxxxxxxxxxxx < xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > I researched this question in this list but I didn't find a recent > response so I'm asking it again. > > My specific requirement is to take the value of an Oxygen deleted content > processing instruction and parse it back into elements in the context of an > XSLT 3 transform. > > The PI is: > > <?oxy_delete author="ekimber" timestamp="20210115T085216-0600" > content="<body><p><ul > id="ul_c5k_mhh_34b"><li>li one</li><li>li > two</li></ul></p></body>"?> > > What I'm failing to work out is how to convert the value of the @content > pseudo-attribute back into a proper XML string that I can pass to > parse-xml(). > > I tried just using replace() to change the various named character > references to their characters but I ran into a use/mention problem with > quotes that I was unable to resolve at the end of the day, which made me > think that perhaps there's a better way or am I just not thinking clearly > about how to handle this kind of string in the context of an XSLT > transform? > > Thanks, > > Elioto;? > > -- > Eliot Kimber > http://contrext.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to Parse String with , David Carlisle d.p.c | Thread | Re: [xsl] How to Parse String with , Martin Honnen martin |
Re: [xsl] How to Parse String with , David Carlisle d.p.c | Date | Re: [xsl] How to Parse String with , Martin Honnen martin |
Month |