As an author of just such a language, this has been a concern of mine ever
since I first read the XML proposal. I posted to this list last week
about this as well.
The language I wrote is called PHP/FI (see http://php.iquest.net/). It is
currently undergoing a complete rewrite, and making sure that I don't
clash with XML is a priority.
My solution, naiive as it might be, is to make hide my language inside a
PI tag. The XML syntax definition for this tag is:
PI ::= '<?' Name S (Char* - (Char* '?>' Char*)) '?>'
This, to me, says that I don't have to worry about a single '>' nor a '<'
inside the tag. It is only a '?>' that could cause me some problems.
So, a typical bit of code would look like:
<?php
$result=mysql("db","select passwd from users where id='$cookie'");
if(mysql_result($result,"passwd")==crypt($input)) {
echo "Welcome $id<BR>\n";
}
?>
Now, my language is a server-parsed language, much like Microsoft's ASP
and NetScape's LiveWire or server-side JavaScript. That means that the
actual browsers out there will never see these tags. However, living at
peace with XML is still important because of XML authoring tools. I would
like people to be able to create XML with an XML authoring tool that
includes my PHP script tags.
This is obviously a hack. Just thought it might be informative for you to
hear the sort of nasty mutilations that you are going to encounter when
XML gets into the hands of ordinary developers who know next to nothing
about SGML/XML.
If the XML spec could address this issue of embedding scripting languages
directly, and provide some guidelines for the developers of these
scripting languages, then it would certainly make life easier on everyone.
Like it or not, these scripting languages are here, and they are not going
to go away. If it is clearly laid out how such a scripting language
should co-exist with XML, the amount of future incompatibilities and
confusion might be reduced.
By the way, a quick look at Microsoft's ASP will reveal that they use
<% ... %> tags. How that is going to survive an XML parser, I have no
idea.
-Rasmus