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



Daniel,

>Daniel Veillard <veillard@redhat.com> wrote about `Re: [xslt] generating malformed XML (html) from malformed XML (xhtml)' on Date: Fri, 14 Nov 2003 06:12:52 -0500
> 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.
........
> > 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 was hoping I could allow the input with either &lt; constructions or
even using %3C etc..

<A href="/all/projects/%3C!--#echo var=%22REMOTE_USER%22 --%3E">Your Projects</A>.

or 

<A href="/all/projects/&lt;!--#echo var=REMOTE_USER --&gt;">Your Projects</A>.

would work.

Both are valid XML and may be mapped to the output I need. But
experimenting didn't make the solution occur to me.

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

This is possibly the neatest way anyway.

Thanks,

Joost


> 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/
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt


-- 
Joost Helberg
Snow B.V.        http://snow.nl Tel 0418-653333 Fax 0418-653666
Voorzitter VOSN  http://www.vosn.nl Tel 0418-653336 Fax 0418-653666



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