[xsl] Transforming xml to tex

Subject: [xsl] Transforming xml to tex
From: Michael Obermeier <michael.obermeier@xxxxxxxxxxxxxxx>
Date: Wed, 16 Jul 2008 21:30:15 +0200
Hello,

I need some help with xslt. I try to transform xml to tex and all is working
except for one point. I have a paragraph tag and inside this a glossary tag
like this: <p>here is the text <glossterm>glossary term</glossterm> more
text</p>

I need to know if there is a punctuation mark after the glossary tag.
I tried following:

  <xsl:variable name="text">
         <xsl:value-of select="normalize-space(syntax:convert(parent::*))"/>
  </xsl:variable>

  <xsl:variable name="glossaryterm">
         <xsl:value-of select="normalize-space(syntax:convert(.))"/>
  </xsl:variable>

  <xsl:variable name="testFall">
        <xsl:value-of select="substring-after($text,$glossaryterm)"/>
  </xsl:variable>
        <xsl:choose>
     <xsl:when test="starts-with($testFall,',') or
starts-with($testFall,';') or starts-with($testFall,'.') or
starts-with($testFall,':') or starts-with($testFall,'?') or
starts-with($testFall,'!') or starts-with($testFall,'(') or
starts-with($testFall,')') or starts-with($testFall,'{') or
starts-with($testFall,'}') or starts-with($testFall,'[') or
starts-with($testFall,']') or starts-with($testFall,'-')">
       <xsl:text>}</xsl:text>
     </xsl:when>
     <xsl:otherwise>
       <xsl:text>} </xsl:text>
     </xsl:otherwise>
   </xsl:choose>

This works only if the $glossaryterm appears only (or at least primarily)
inside the glossterm. Otherwise the $testFall contains not want I need.

Has anybody an idea how I can get the first character after the glossterm.

Many thanks

Michael
--
Michael Obermeier
UNICO Media GmbH
Softwareentwicklung & Support
Aldringenstra_e 4

80639 M|nchen
UNICO Media GmbH
Geschdftsf|hrer Christian Fuchs
Amtsgericht HRB 116178
Sitz der Gesellschaft ist M|nchen


Tel. +49-(0)89-1893533-21
Fax  +49-(0)89-1893533-11

Current Thread