>> Simple question about escaping content in XSL

G

gene.ellis

Hey everyone,

There is probably a really simple solution. I have an XSL document that
reads into content from my XML document and creates an HTML document
(with a .php extension). There is some PHP code I would like to include
on the XSL document, however I don't want to XML/XSL engine to try and
interpret it. I would simply like the PHP code to pass through from the
XSL document and be included on the HTML document unchanged. From there
it will simply be evaluated at run-time like a typical HTML document
(with a .php extension) would. So basically, how do I simply pass it
the PHP code through? Do I need to escape it somehow? I thank you in
advance.

Gene
 
S

Soren Kuula

Hey everyone,

There is probably a really simple solution. I have an XSL document that
reads into content from my XML document and creates an HTML document
(with a .php extension). There is some PHP code I would like to include
on the XSL document, however I don't want to XML/XSL engine to try and
interpret it. I would simply like the PHP code to pass through from the
XSL document and be included on the HTML document unchanged. From there
it will simply be evaluated at run-time like a typical HTML document
(with a .php extension) would. So basically, how do I simply pass it
the PHP code through? Do I need to escape it somehow? I thank you in
advance.

As far asa I can see, <?php blah....?> is a processing instruction. You
should just have a template like <xsl:template
match=processing-instruction()><xsl:copy-of select="."/><(xsl:template>
somewhere; it should copy the php. You might get some challenges keeping
the php-infes... uh, enriched HTML as valid xml, I mean <, ? and >
inside the processing instructions. I suppose it's XHTML?

Soren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top