RE: RE: [xsl] html tables with XSL

Subject: RE: RE: [xsl] html tables with XSL
From: Deepak <deepak_vn@xxxxxxxxx>
Date: Thu, 12 Jan 2006 02:05:54 -0800 (PST)
Hi Charles,

I don't think mailing list will allow to use
attachments.

> 
> So, is it that you want a table with a new row for
> <elementid> containing the string "properties"?

Not exactly,

 Below attached XSL and XML. If we transform the XML
using the XSL provided, then we can see  the table
columns are not aligned properly.

Thanks,Pradeep


--0-1237714426-1137022967=:94530

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:java="http://xml.apache.org/xslt/java"; 
xmlns:lxslt="http://xml.apache.org/xslt";>
	<xsl:template match="/">
		<table border="1">
			<TR>
				<TH COLSPAN="1" bgcolor="#E0E0E0">Name</TH>
				<TH COLSPAN="1" bgcolor="#E0E0E0">Key
Properties</TH>
			</TR>
			<xsl:apply-templates select="Formelements/Form">
			</xsl:apply-templates>
		</table>
	</xsl:template>
	<xsl:template match="Form">
		<tr>
			<td align="left" valign="top">
			<xsl:if test="contains(string(elementid), 'name')">
					<ul>
						<li>
							<xsl:value-of select="elementid">
							</xsl:value-of>
						</li>
						</ul>
						</xsl:if>
								<xsl:if test="contains(string(elementid),
'address')">
					<ul>
						<li>
							<xsl:value-of select="elementid">
							</xsl:value-of>
						</li>
						</ul>
						</xsl:if>
						</td>
							<td align="right" valign="top">
						<xsl:if test="contains(string(elementid),
'properties')">
					<ul>
						<li>
							<xsl:value-of select="elementid">
							</xsl:value-of>
						</li>
						</ul>
						</xsl:if>
						</td>
						<td align="right" valign="top">
				
						</td>
	</tr>
	
	</xsl:template>
	</xsl:stylesheet>

--0-1237714426-1137022967=:94530
<?xml version="1.0" encoding="UTF-8"?>
<Formelements>
<Form>
	<elementid>samename</elementid>
</Form>
<Form>
	<elementid>address</elementid>
</Form>
<Form>
	<elementid>properties1</elementid>
</Form>
<Form>
	<elementid>properties2</elementid>
</Form>
<Form>
	<elementid>properties3</elementid>
</Form>
</Formelements>
--0-1237714426-1137022967=:94530--




--- cknell@xxxxxxxxxx wrote:

> 
> So, is it that you want a table with a new row for
> <elementid> containing the string "properties"?
> -- 
> Charles Knell
> cknell@xxxxxxxxxx - email
> 
> 
> 
> -----Original Message-----
> From:     Deepak <deepak_vn@xxxxxxxxx>
> Sent:     Wed, 11 Jan 2006 14:02:09 -0800 (PST)
> To:      
> xsl-list@xxxxxxxxxxxxxxxxxxxxxx;cknell@xxxxxxxxxx
> Subject:  RE: [xsl] html tables with XSL
> 
> 
> Hi Charles,
> 
> Thanks for the reply.
> 
> Attached XSL,XML file and expected HTML result. 
> 
> Thanks & Regards,Deepak
> 
> 
> --- cknell@xxxxxxxxxx wrote:
> 
> > Please post your templates for processing the
> > <Forms> and <Form> elements. We can quickly fix
> them
> > for you.
> > -- 
> > Charles Knell
> > cknell@xxxxxxxxxx - email
> > 
> > 
> > 
> > -----Original Message-----
> > From:     Deepak <deepak_vn@xxxxxxxxx>
> > Sent:     Wed, 11 Jan 2006 08:28:40 -0800 (PST)
> > To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  [xsl] html tables with XSL
> > 
> > Hi,
> > 
> >  Am bit new to XSL programming, so please help me
> to
> > solve this problem.
> > 
> > I am trying to publish html vis XSL trnasformation
> > and
> > display should be showing the datas in different
> > columns in the table.
> > 
> > My XML File looks somewhat like 
> > 
> > <Forms>
> >    <Form>
> >    <Form>
> >    <Form>
> >    ....
> > <Forms>
> > 
> > After XSL processing, display looks like :
> > 
> >  <html>
> >       <table>
> >          <tr>
> >            <td>Form </td>
> >          </tr>
> >          <tr>
> >            <td>Form </td>
> >          </tr>
> >       </table>
> > 
> > My purpose is, i have to process different datas
> in
> > <Form> element and display different table columns
> > rather than displaying in different rows.  
> > 
> > Unfortuntely display looks depnds on the flow in
> the
> > XML file, how i can align or specify the columns
> in
> > the tables using XSL.
> > 
> > Thanks,
> > Deepak
> > 
> > 
> > 
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > http://mail.yahoo.com 
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> 
---------------------------------
~



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Current Thread
  • [xsl] html tables with XSL
    • Deepak - Wed, 11 Jan 2006 08:27:01 -0800 (PST)
      • <Possible follow-ups>
      • Deepak - Wed, 11 Jan 2006 08:28:40 -0800 (PST)
      • cknell - Wed, 11 Jan 2006 13:32:02 -0500
      • Deepak - Thu, 12 Jan 2006 02:05:54 -0800 (PST) <=
      • Deepak - Thu, 12 Jan 2006 02:06:02 -0800 (PST)
      • cknell - Thu, 12 Jan 2006 07:20:38 -0500
        • Deepak - Fri, 13 Jan 2006 03:08:48 -0800 (PST)
          • Deepak - Fri, 13 Jan 2006 07:13:41 -0800 (PST)