Re: [xsl] XSLT w/ PHP, ASP, JSP Processing Instructions

Subject: Re: [xsl] XSLT w/ PHP, ASP, JSP Processing Instructions
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 5 Dec 2005 21:19:34 GMT
> But I'm a little worried because Saxon complains that the two templates
> are ambiguous. I guess node() also selects PIs? Is there a way to excplide
>'php' PIs from The Identity Transform?

Just add a priority="1001" to the template matching pis.

> The problem is that the HTML spec does not permit processing instructions
> like:
> 
>   <?foo ... ?>

No, it doesn't. HTML (well actually SGML) just defines the syntax of a
PI to be terminated with ?. So the ? is part of the content of the
processing instruction not part of the syntax. That is the case if an
HTML file contains
<?xxx yyy ?>
whether or not it's OHP or generated by XSLT. The content of that PI is
name xxx and content "yyy ?"
If that's the form PHP needs that's just the way it is.

> Even if it were practical to use entity references for these
> characters (which it's not),
you can't have entity references in a PI (as & is not special, so there
is no syntax for a reference)

> Also XHTML does not have <?xml
> version="1.0"?> at the top AFAIK.

Huh? This is just XML syntax, this is of course allowed (and mandatatory
if the xhtml is not in utf 8 or 16)

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread