|
Subject: Re: [xsl] XML from JSP From: Mike Brown <mike@xxxxxxxx> Date: Fri, 15 Nov 2002 17:15:37 -0700 (MST) |
sara.mitchell@xxxxxxxxx wrote:
> The JSP directive:
>
>
> > -----Original Message-----
> > <%
> > String block = "work";
> > %>
>
> is not well-formed XML. The XML parser expects
> that anything beginning with < represents
> XML markup. (Note: parsers don't compile
> XML, they parse it.)
>
> To make it well-formed, you need to have the
> JSP directive inside a CDATA marked section
> like this:
>
> <![CDATA[<%
> String block = "work";
> %>]]>
And to answer the inevitable next question, CDATA sections are lexical fluff,
so the document author might as well just write
<%
String block = "work";
%>
Either way, they have to use either
1. directly serialized XML or HTML output mode, with
disable-output-escaping (if supported at all); or
2. text output mode, after having assembled the entire document
as nothing but text nodes containing pseudo-markup like this.
Personally, I would instead use XML output mode and make elements that will be
serialized in JSP's XML syntax, or maybe I'd emit processing instructions and
run the serialized output through a regex filter to replace the PIs with the
appropriate tags.
- Mike
____________________________________________________________________________
mike j. brown | xml/xslt: http://skew.org/xml/
denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] XML from JSP, sara . mitchell | Thread | Re: [xsl] XML from JSP, Mike Brown |
| RE: [xsl] Superscript text, Marko Petersen | Date | Re: [xsl] XML from JSP, Mike Brown |
| Month |