Re: [xslt] generating malformed XML (html) from malformed XML (xhtml)



On Thu, Nov 13, 2003 at 09:59:19PM +0100, Joost Helberg wrote:
> ls,
> 
> I've written an XSLT-stylesheet in order to map XHTML to HTML. Most
> XHTML elements are kept intact (i.e. copied) except for HEAD and META.
> 
> The following (malformed) XHTML-code appears on the input:
> 
>    <A href="/all/projects/<!--#echo var="REMOTE_USER" -->">Your Projects</A>
> 
> This uses an Apache feature called Server Side Includes. The
> expression   <!--#echo var="REMOTE_USER" -->
> is transformed by the HTTP server to the name of the authenticated
> user.
> 
> I'm not able to copy this input. As a lot of XML violations occur (<
> inside attribute value, " too). xsltproc bombs out of course.

  Well it's clearly not XML. It's not xsltproc which fails but
the XML parser trying to load your input.

> Does any of you have a good idea on how to implement this?

  Well it's not XML, you can't parse it with an XML parser.
I have no good idea about how to parse this, this is not XML
nor HTML, apparently Apache Server Side Includes are supposed 
to be processed before being passed to the XML or HTML parser,
so it seems unlikely you can find a good solution at the XML
level for what you want.

> I'd rather not introduce a new element (e.g. myA) which supports an
> extra attribute of some sort.

  That would be one way ...

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]