Subject: RE: [xsl] #Please Help: Nested conditions From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 21 Feb 2004 08:59:41 -0500 |
<Q> <xsl:template match="TABLE"> <Q> <TABLE> <Q> ... <Q> <xsl:if test="TROW/TH"> You are looking here for all <TH> that are children of a <TROW>;
however, if I know that all <TH> will always be in a <TROW>, I could write also <xsl:if test="TH">
, couldn't I? Or would this imply here that I would be looking for <TH> that are children of <TABLE>?
<Q> <xsl:apply-templates select="TROW[TH]"/> A similar expression I have found in M. Kay's "XSLT P.R.2" at the item "PredicateExpr". This is not where I would have looked for it, simply because I've never heard the term "PredicateExpr"...
<Q> <xsl:copy><xsl:apply-templates/></xsl:copy> I would have written: <TROW><xsl:apply-templates/></TROW> but I assume it would have been the same. Correct?
<Q> > <xsl:text disable-output-escaping="yes"> <Q> > </TGROUP></xsl:text> <Q> The above is expressly *not* the purpose of <Q> disable-output-escaping= ... I have used it as well to produce the DOCTYPE -- would that be ok?
T:\ftemp>type matthias.xsl <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/"> <xsl:apply-templates select="/XML/TABLE"/> </xsl:template>
<xsl:template match="TABLE"> <TABLE> <TTITLE> <xsl:apply-templates select="CAPTION/Table-TITLE"/> </TTITLE> <xsl:if test="ROW/TH"> <THEAD> <xsl:apply-templates select="ROW[TH]"/> </THEAD> </xsl:if> <TBODY> <xsl:apply-templates select="ROW[CELL]"/> </TBODY> </TABLE> </xsl:template>
<xsl:template match="ROW"> <TROW><xsl:apply-templates/></TROW> </xsl:template>
<xsl:template match="TH|CELL"> <TDATA><xsl:apply-templates/></TDATA> </xsl:template>
<!--eat empty text nodes--> <xsl:template match="text()[not(normalize-space())]"/>
T:\ftemp>saxon matthias.xml matthias.xsl <?xml version="1.0" encoding="utf-8"?> <TABLE> <TTITLE> Processi di depurazione</TTITLE> <THEAD> <TROW> <TDATA> Processi/sostanze</TDATA> </TROW> </THEAD> <TBODY> <TROW> <TDATA> Concentrazione di fanghi, sabbia od altri solidi in sospensione delle acque</TDATA> </TROW> <TROW> <TDATA> Concentrazione di sabbie od altri solidi granulosi in sospensione nell' acqua</TDATA> </TROW> <TROW> <TDATA> Separazione di solidi grossolani trascinati da una corrente d' acqua</TDATA> </TROW> <TROW> <TDATA> Raccolta dei surnatanti presenti sulla superficie delle acque</TDATA> </TROW> <TROW> <TDATA> Espulsione dei gas o vapori in sospensione nelle acque</TDATA> </TROW> </TBODY> </TABLE>
-- Public courses: upcoming world tour of hands-on XSL training events Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22 Hong Kong: 2004-05-17 Germany: 2004-05-24 England: 2004-06-07 World-wide on-site corporate, government & user group XML training!
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] #Please Help: Nested cond, Matthias Fischer | Thread | Re: [xsl] #Please Help: Nested cond, J.Pietschmann |
RE: [xsl] Merging multiple XHTML do, Andreas L. Delmelle | Date | RE: Xquery for 'hard data probs' wa, Jim Fuller |
Month |