Subject: RE: [xsl] step-by-step work instructions -- recursive apply-templ ates to cr eate html table From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx> Date: Wed, 9 Apr 2003 14:14:59 -0400 |
Thanks for answering! This looks like the format part is working...except I'm not getting any text from within the steps, para, etc.??? kathy -----Original Message----- From: Américo Albuquerque [mailto:aalbuquerque@xxxxxxxxxxxxxxxx] Sent: Wednesday, April 09, 2003 1:36 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: [xsl] step-by-step work instructions -- recursive apply-templates to cr eate html table Hi. > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of > Kathy Burke > Sent: Wednesday, April 09, 2003 5:03 PM > To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx' > Subject: [xsl] step-by-step work instructions -- recursive > apply-templates to cr eate html table > > > I've been asking for help with this on dev forum so please > forgive me if this is a cross-post. No one seems to want to > help me on this one...? I've tried looking at doc book for > examples, but SO complicated I can't figure it out. I've also > read this FAQ and other posts ...very enlightening but my XML > "light" hasn't quite gone on yet! > > I'm trying to create a table for work instructions: up to 5 > nested <step> elements with sub elements sometimes included > (measure, href, etc.) I've tried combinations of > choose/when/if etc. but either I get the numbering correct > (which needs to be outline format 1., 1.1, 1.1.1, 1.1.1.1, or > 1.1.1.1.1) or it also numbers the multiple para's within a You can do this with <xsl:number level="multiple" count="step" format="1.1"/> You could try this and change it to your needs: <xsl:template match="process_steps"> <table border="0"> <xsl:apply-templates/> </table> </xsl:template> <xsl:template match="step"> <xsl:variable name="space" select="(count(ancestor::step) * 13 + 1) * 7"/> <tr> <td width="140" valign="top"> <xsl:apply-templates select="@ckbox[.='yes']"/> </td> <td valign="top"> <table width="100%" border="0"> <tr> <td valign="top" width="{$space}"> <table border="0"> <tr> <td width="{$space}"> </td> <td> <xsl:number level="multiple" count="step" format="1.1"/> <xsl:if test="not(ancestor::step)"><xsl:text>.</xsl:text></xsl:if> <xsl:text>	</xsl:text> </td> </tr> </table> </td> <td> <xsl:apply-templates select="*[not(self::step)]"/> </td> </tr> </table> </td> </tr> <xsl:apply-templates select="step"/> </xsl:template> <xsl:template match="@ckbox"> <input type="checkbox"> <xsl:if test=".='yes'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> </input> </xsl:template> <xsl:template match="para"> <p> <xsl:apply-templates/> </p> </xsl:template> <xsl:template match="measure"> <!-- you could also use a textarea instead --> <input type="text" value="{.}"/> </xsl:template> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Saxon is adding line brea, Passin, Tom | Thread | RE: [xsl] step-by-step work instruc, Américo Albuquerque |
[xsl] Saxon is adding line breaks, mark_fletcher | Date | RE: [xsl] Limitation of <xsl:result, Michael Kay |
Month |