Subject: Re: [xsl] Creating nested structures From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 23 Jan 2004 17:47:49 -0500 |
your question: "Or is this actually the case, and do you really want your result to have tables inside td (cell) elements? which is common enough in HTML"
Answer is "yes I want to have my results to have tables inside td elements.
I have included a snippet of the html input I parse to the xml structure I listed above. Also <TABLE> = <table>; <DPROW> = <tr>; and <OBJECT> = <td>
input html snippet:
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="842"><TR><TD WIDTH="3"></TD><TD><TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR HEIGHT="6"><TD WIDTH="4"></TD><TD WIDTH="22"></TD><TD WIDTH="67"></TD><TD WIDTH="2"></TD><TD WIDTH="211"></TD><TD WIDTH="2"></TD><TD WIDTH="273"></TD><TD WIDTH="48"></TD><TD WIDTH="92"></TD><TD WIDTH="2"></TD><TD WIDTH="2"></TD><TD WIDTH="82"></TD><TD WIDTH="6"></TD><TD WIDTH="22"></TD><TD WIDTH="5"></TD></TR><TR><TD WIDTH="4"></TD><TD WIDTH="22"></TD><TD WIDTH="67" VALIGN="TOP"><TABLE BORDER="0" WIDTH="66"><TR><TD CLASS="s2">Agent ID:</TD></TR></TABLE></TD><TD WIDTH="2" COLSPAN="2" VALIGN="TOP"><TABLE BORDER="0" WIDTH="212"><TR><TD CLASS="s3">100008</TD></TR></TABLE></TD><TD WIDTH="2"></TD><TD WIDTH="273"></TD><TD WIDTH="48"></TD><TD WIDTH="92"></TD><TD WIDTH="2"></TD><TD WIDTH="2" COLSPAN="2" VALIGN="TOP"><TABLE BORDER="0" WIDTH="84"><TR><TD CLASS="s4">12/19/2003</TD></TR></TABLE></TD><TD WIDTH="6"></TD><TD WIDTH="22"></TD><TD WIDTH="5"></TD><TD HEIGHT="20"></TD></TR><TR><TD WIDTH="4"></TD><TD WIDTH="22" COLSPAN="3" ROWSPAN="2" VALIGN="TOP"><TABLE BORDER="0" WIDTH="90"><TR><TD CLASS="s2">Agent Name:</TD></TR></TABLE></TD><TD WIDTH="211"></TD><TD WIDTH="2"></TD><TD WIDTH="273"></TD><TD WIDTH="48"></TD><TD WIDTH="92" COLSPAN="3" ROWSPAN="2" VALIGN="TOP"><TABLE BORDER="0" WIDTH="96"><TR><TD CLASS="s4">Report Date:</TD></TR></TABLE></TD><TD WIDTH="82" COLSPAN="3" ROWSPAN="2" VALIGN="TOP"><TABLE BORDER="0"
<xsl:template match="TABLE"> <table> <xsl:apply-templates/> </table> </xsl:template>
<xsl:template match="DPROW"><!-- sorry, earlier I called it "DROW" --> <tr> <xsl:apply-templates/> </tr> </xsl:template>
<xsl:template match="OBJECT"> <td> <!-- first, whatever you want to do to show empty objects --> ... <!-- then, continue tree traversal for the data content and the nested tables by applying templates --> <xsl:apply-templates/> </td> </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Creating nested structure, scott gabelhart | Thread | [xsl] Converting HTML to xml, scott gabelhart |
Re: [xsl] finding unique nodes, Paul Tremblay | Date | [xsl] How to style an XSD schema us, Mila Mitra [pmitra@x |
Month |