Re: [xslt] XSLT puts carriage return in html tag name
- From: Pramod Kankure <pkankure yahoo com>
- To: xslt gnome org
- Subject: Re: [xslt] XSLT puts carriage return in html tag name
- Date: Tue, 12 Mar 2002 11:04:01 -0800 (PST)
Hi
Was this a problem with earlier version of XSLT
processor ??
Here is a input xml
<?xml version="1.0"
encoding="ISO-8859-1"?><SoftwareInfo security="Public"
source="SWG PI Application 7.0" format="text/XML"
docsubtype="" docid="" versionid="DBLH-57YN47"
doctype="Progeny - How to buy" status="Active"
webstatus="Production" productsaz="Yes"
publishedfrom="PI" lastUpdate="2002-03-08"
expire="2002-09-06" documentLanguageCode="en"
documentCountryCode="us"> <Xlink inline="true"
show="replace" actuate="user" content-role="Related
Services" title="Related Services" content-title=""
xml:link="extended"> <Locator title="Business Partner
Directory" show="replace" actuate="user"
href="http://www.xxx.com/cgi-bin/d2w/reseller/resell/input"
xml:link="locator"/> <Locator title="XXXX"
show="replace" actuate="user"
href="http://www.xxx.com/services/kcm/know_mngt_con.html"
xml:link="locator"/> </Xlink> <Xlink inline="true"
show="replace" actuate="user" content-role="Related
Solutions" title="Related Solutions" content-title=""
xml:link="extended"> <Locator title="Complementary
software, hardware and services" show="replace"
actuate="user"
href="/software/data/cm/about_cmcp.html"
xml:link="locator"/></Xlink></SoftwareInfo>
The corresponding XSLT is
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="html" version="1.0"
encoding="UTF-8" indent="yes"/>
<xsl:param name="cntry"></xsl:param>
<xsl:strip-space elements="*"/>
<xsl:variable name="docType"
select="/SoftwareInfo/OverviewDoc/SoftwareInfo/@doctype"
/>
<xsl:template match="/">
<html>
<head>
</head>
<body bgcolor="#ffffff" marginheight="2"
marginwidth="2" topmargin="2" leftmargin="2"
alink="#006699">
<table>
<xsl:variable name="navExists"
select="/SoftwareInfo/OverviewDoc/SoftwareInfo/Navigation[@role='WebNavigation']/Xlink[normalize-space(@content-role)='Related
Solutions']/Locator/@title"></xsl:variable>
<xsl:if test="string-length($navExists)!=0">
<tr>
<td colspan="2">Related solutions:</td>
</tr>
<xsl:for-each
select="/SoftwareInfo/OverviewDoc/SoftwareInfo/Navigation[@role='WebNavigation']/Xlink[normalize-space(@content-role)='Related
Solutions']/Locator" >
<tr>
<td width="5"></td>
<td width="145">
<a class="rlinks">
<xsl:attribute name="href">
<xsl:value-of select="./@href" />
</xsl:attribute>
<xsl:value-of select="./@title" />
</a></td></tr>
</xsl:for-each>
</xsl:if>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Hope this helps
Pramod
--- Daniel Veillard <veillard@redhat.com> wrote:
> On Mon, Mar 11, 2002 at 11:39:34AM -0500, Daniel
> Veillard wrote:
> > On Mon, Mar 11, 2002 at 08:13:04AM -0800, Pramod
> Kankure wrote:
> > > hello All
> > >
> > > I am converting XML to HTML using a XSLT
> stylesheet
> > > and sending the output dynamically to browser.
> > > Sometimes XSLT put extra whitespace in the HTML
> tag..
> > > e.g
> > > for ending tag </tr> it puts < then a carriage
> return
> > > and then /tr>.. This causes HTML page not to
> render
> > > appropriately.
>
> Looking at the associated HTML serialization code
>
> xmlOutputBufferWriteString(buf, "</");
> xmlOutputBufferWriteString(buf, (const char
> *)cur->name);
> xmlOutputBufferWriteString(buf, ">");
>
> I really don't see how this can happen. Please
> reproduce the
> problem with xsltproc and provide the stylesheet and
> input exhibiting
> the problem.
>
> 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
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]