Re: [xslt] libxslt escaping urls when outputting HTML



Well without further ado, you are RIGHT! 

Well at least as globals go etc,etc... The point I was trying to make is
simply: 

Different serialisation for html seems to be a common request. 
This request is always responded to with "That not standard" 
I think not standard is not an excuse because it hampers invention 

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"/> 

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. 

Summary: It's not the topic I disagree on it's the "standard's
respospne" I dislike. 

TTY Philipp 

P.S.: As always everyone is invited (and to some degree expected) to
disagree with me, since I see this as a valuable way of learning (at
least for me) 

On Mon, 2002-09-16 at 18:16, Le grande pinguin wrote: 
> On Mon, Sep 16, 2002 at 11:36:27AM +0200, Philipp Dunkel wrote:
> > If you remember we had this discussion about a month ago as well. Back
> > then I gave up.
> > I just wanted you to think about one thing:
> > Invention is using things that exist in a totally unpredicted new way.
> > There seem to be a lot of people having troubles with URL-escaping, some
> > of them resorting to patching libxslt (I did for my own use, but did not
> > distribute since I don't want to fork or even put down your great work,
> > especially since in terms of experience and knowledge your are by far
> > the better programmer). Now This part of libxslt is not really that much
> > of a core functionality, that it really matters that much. 
> 
> This is a dangerous statement, to say the least. If it doesn't break 
> _your_ code this doen't mean it doesn't break someones carefully 
> crafted standard conformant code somewhere (no, not mine, i case you
> ask :)
> 
> > And the
> > behavior that is currently there is absolutely the right thing as a
> > default. But if it's not really a core issue, why not make it a runtime
> > option. I could, during initialization just call IllegalEscaping(1); and
> > the URL-escaping would be turned of and left up to me to do within the
> > XSL.
> 
> Please, _no_ more globals! If you use libxml in an environment where
> the library might be needed by several components of an application
> (webserver with loadable modules, for example) this setup is asking
> for trouble. Imagine module A loading libxml and setting IllegalEscaping to
> true. Then, at some point some serveradmin installs module B which happens
> to set IllegalEscaping to false, and all a sudden module A stops working
> the way it used to ...
> 
> > I need it and modified libxslt according to my needs, but is that the
> > right way to do things for an issue like that? I don't think so. So why
> > not take a more practical approach and make this change choosable at
> > init-time. It would eliminate this discussion and make everyone happy: A
> > standards compliant parser by default. WIth some neat extras if you
> > really need them for a specific instance.
> > Now this is just a thought, and I presume you have had it before.Non the
> > less, I would be quite interrested in hearing your reasoning about why
> > not to follow a path like that.
> > 
> Well, the two possible solutions is see are:
> 
>  - since this is a problem of serialisation, why not modify the
>    serialisation code? Write your own (copying Daniels html-
>    serializer) version that does the wanted escaping.
> 
>  - Create an xslt extension function and use it in your transformation:
> 
>     <a href='{pd:ugly-escape(@href)}'>My link</a>
> 
> 
> 
>   Ralf Mattes 
> 
> _______________________________________________
> xslt mailing list, project page http://xmlsoft.org/XSLT/
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt




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