Subject: Re: <xsl:choose> <xsl:when> and graphics salad! From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 5 Apr 2000 14:12:35 +0100 (BST) |
me> but it's not possible to say without seeing an input example. > but I warn you its lengthy. it's also not the _input_ its the stylesheet. but guessing what the input looks like from your stylesheet I can make some comments (same comments as the first time I suspect) <xsl:template match="image"> <xsl:choose> so far so good. <xsl:when test="contains (@align,'banner')"> </xsl:when> so if you have <image align="xxbannerxx" (any other attributes)>... </image> then you get no output at all <xsl:when test="contains (@align,'right')"> if you have <image align='xxrightxx'... then <xsl:if test="contains(/text/@text.role,'note')"> It is pointless having a test using an absolute path like this _inside_ the image template. It means the system has to go and fetch this node each time and evaluate this expression, but you get the same value true or false for _every_ image, as the test does not use any of the data in the image element. It is false unless your top level document element is <text text.role='note'/> so you may as well test for that at the top level of the stylesheet. (<xsl:value-of select="//para/@secur.classif"/>) similarly this is OK but may as well be at the top level of your stylesheet as it just slows things down working it out again for each image. It always just gives you the secur.classif of the first para element anywhere in the document. <xsl:value-of select="text"/> ... So does your input look like <?xml version ="1.0> <text text.role='note'> ..... <image align='right' reference='xxx'> <text> stuff</text> <illust> more stuff</illust> <image> .... <text> If so the stylesheet looks about right, if not then some of your select expressions will be returning empty node lists. avid XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: <xsl:choose> <xsl:when> and gra, Medina, Edward | Thread | RE: <xsl:choose> <xsl:when> and gra, Medina, Edward |
Re: Sorting problem with Xalan 1.0., David Carlisle | Date | RE: Wanted: All unique namespaces i, Kay Michael |
Month |