Re: [xslt] problem with html output



Ralf was so kind as to say that it's just not valid therefore you can't
do it.

Well output method html outputs valid html. What you want to output
isn'y html it's either php or ssi or some other such markup which does
not conform to either the HTML or the XML specification.

I am personally an advocate of permitting such output constructs,
because they may often be very desireable in real life. But the standard
conformance advocates (which Ralf and Daniel both are) are saying that
if libxml/libxslt conforms to the very strictest interpretation of XML
and XSL that is a good thing.

Now that's something that you can have a long discussion pro and con. I
think it's sort of unrealistic. But I do agree with them to the extent
that we have all seen what lax implementations of standards have done by
looking at Netscape vs. IE. It took a major browser war which has now
turned into a cold war with Linuxites curretnly apperntly at the loosing
end. I hope things will change. So with that in mind I think the policy
of strict standards compliance is a good one for the long run.

But that doesn't solve you problem, does it. One thing you might think
of doing is changing the output method to text. And then outputting all
htmltags manually by doing:
<xsl:template match="/">
&lt;html&gt;
&lt;body&gt;
This is the result doc &lt;a href=&quot;&lt;? echo $url;
?&gt;&quot;&gt;link to somewhere&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</xsl:template>
Admittedly this looks quite gruesome. Aside from that there are a lot of
details you have to take care of manually as well such as the
declaration of the output encoding. But that would, at least in my eyes
be the standards compliant way to do things.

So having said that. I do not intend to have a big mail war on the pros
and cons of decisions made by Daniel, the comittee for XML or XSL, or my
personal opinion on it. I just thought it would be worth while to
explain the reasoning behind Ralfs short answer from what I think it
was.

TTY Philipp

On Sun, 2002-11-03 at 16:31, Panard wrote:
> Hi !
> 
> 	How to have an ouput like
> 	<a href="<? echo $url; ?>">.......
> with an html ouput ? 
> I've tried with 
> 	<xsl:element name="a">
> 		<xsl:attribute name="href">
> 			<xsl:text disable-output-escaping><![CDATA[ <? echo $url; ?> ]]></xsl:text>
> 		</xsl:attribute>
> 	</xsl:element>
> but it doesn't work !
> 
> Thanks
> 
> -- 
> ________________________________________________________
>          panard@inzenet.org                http://www.inzenet.org
> _______________________________________________
> 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]