Re: [xslt] libxslt escaping urls when outputting HTML



On Tue, Sep 17, 2002 at 01:27:56PM +0200, Le grande pinguin wrote:
> On Tue, Sep 17, 2002 at 02:23:55AM +0200, Philipp Dunkel wrote:
> > On the point of globals I have to agree and retract my solution. It's OK
> > for me for the time being. This is the reason I didn't publish it. I had
> > a feeling, that it was a horrible hack, and should not really be used.
> > It was actually more of an experiment than anything useful. 
> > 
> > The serialisation idea sounds good. How about <xsl:output
> > method="html-with-illegal-hrefs"/> 
> 
> Yes, to me it looks like the cleanest solution -- unfortunately, after
> browsing the sources for a while i got the impression that it's not that
> trivial to extend the set of output methods. To me it looks like the
> existing methods are pretty much hardcoded into libxslt :-( 
> <Daniel, please correct me if i'm wrong>

  yes they are hardcoded, because they are hardcoded in the specification,
and if you want to provide your own serialization simply write your own
version of xsltSaveResult... equivalent.

> As a long-term solution it might be interessting to have 'plugable' serializers,
> but otoh there might be little common code left to serialisation once you have
> plugins, so maybe you realy need to write your own serializer (the only benefit
> speaking for the plugin aproach would be the ability to set the serializer from
> within the stylesheet).

  Right I could make it easy by providing an API for new serialization
methods provided by the user code. 
  
> > Just thinking out loud. This could be included without doing any harm,
> > wouldn't cause any standards problem, since I think someone writing an
> > xsl with an output method named like that will know that they are doing
> > something quite unstandard. 
> > 
> > Well I play the though through and might act on it if I needit. 
> 
> Lookin' forward to see the outcome ;-)

   The problem is that basically one need to duplicate the code of the
HTML serializer, and this just for ensuring a "non conformant to the spec"
behaviour that 99% of the users should not use. Understand it sounds like
bloat to them ... the HTML serializer is part of libxml2, adding an xhtml
serializer could be added reasonably but one just for not doing the 
processing that the HTML spec requires on URI-References when serializing,
err it's just too much IMHO...

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]