Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] thumb index creation

From: "Michael Kay" <mike@------------>
To:
Date: 6/4/2007 8:49:00 AM
I'm not sure exactly what you want, but this code is almost certainly wrong:

<xsl:for-each select="//title"> 
  <xsl:choose> 
     <xsl:when test="//title='Seminare'"> 

That's saying "for every title in the document, if there is some title
somewhere in the document equal to 'Seminare'...". You probably meant "if
this title is 'Seminare'", which would be

<xsl:for-each select="//title"> 
  <xsl:choose> 
     <xsl:when test=".='Seminare'"> 

I'm afraid it's not surprising you didn't find the problem in the archives.
10% of the queries on this list are due to people getting the context of
their path expressions wrong, but it they knew that was the issue then they
wouldn't need to ask the question.

Be very careful before using "//". A lot of beginners seem to throw it in
for luck, without understanding what it does.

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Andreas Peter [mailto:info@xxxxxxxxxx] 
> Sent: 04 June 2007 07:29
> To: XSL-LIST
> Subject: [xsl] thumb index creation
> 
> Hello together,
> 
> I did my homework and asked the archive but I found nothing 
> about my problem. Here some facts...
> 
> At the moment I am working on a thumb index for a broschure. 
> My problem is that I do not know how to address the content 
> of an element (plain text). For example I want to address the 
> content (here Seminare or Fachseminare ...) of the element 
> <title>Seminare</title> for my thumb index. That means each 
> time the tag <title> appears in the XML-file a thumb index 
> should be created depending on the content.
> 
> For example:
> <title>Seminare</title> => red thumb index 
> <title>Fachseminare</title> => green thumb index
> 
> 
> More concrete:
> The XML-File (in extracts):
> 
> ...
> <title>Seminare</title>
> ...
> <title>Fachseminare</title>
> ...
> 
> My XSL-File (in extracts):
> 
> ...
> <fo:static-content flow-name="thumb.left"> <fo:block> 
> <xsl:for-each select="//title"> <xsl:choose> <xsl:when 
> test="//title='Seminare'"> <fo:block-container 
> position="absolute" top="0mm" right="94mm"
> height="25mm" width="5mm" background-color="rgb(172,207,204)">
> <fo:block />
> </fo:block-container>
> </xsl:when>
> <xsl:when test="//title='Fachseminare'"> <fo:block-container 
> position="absolute" top="25mm" right="94mm"
> height="25mm" width="5mm" background-color="rgb(89,82,65)"> 
> <fo:block></fo:block> </fo:block-container> </xsl:when> 
> <xsl:when test="//title='Vortraege'"> <fo:block-container 
> position="absolute" top="50mm" right="94mm"
> height="25mm" width="5mm" background-color="rgb(89,82,65)"> 
> <fo:block></fo:block> </fo:block-container> </xsl:when> 
> </xsl:choose> </xsl:for-each> </fo:block> </fo:static-content> ...
> 
> If I use the code above, only the first <title> will be 
> matched as a thumb index. Any ideas out there? Would be quite helpful.
> 
> Thanks so much,
> Andreas


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent