xsl-list
[Top] [All Lists]

struggling with <xsl:analyze-string>

2005-01-26 08:10:43
Hi

In my deepest hour of sorrows I write to you once more...
I just took a closer look to the <xsl:analyze-string> instruction.

XML fragment (I have no control of the structure as you can see ;)):

<par class="45_UeberschrPara" xml:lang="en" style="word-break-inside: 
hyphenate; color: #000000; ">In-Kraft-Treten</par>
<par class="51_Abs" xml:lang="en" style="word-break-inside: hyphenate; ">
        <inline class="991_GldSymbol">§ 2.</inline>
        <inline style="color: #000000;">
        <inline style="font-weight: bold;"> </inline>Diese Verordnung tritt mit 
4. Jänner 2005 in Kraft.</inline>
</par>
<par class="68_UnterschrL" xml:lang="en" style="word-break-inside: hyphenate; 
color: #000000; ">Pribil  Traumüller</par>


What I need to do: 

I need to search in all nodes after par[(_at_)class='45_UeberschrPara'] for a 
date in the Format "[DD]. [Mn] [YYYY]" and pass this date to a named template.
So far so good.

I thought that <xsl:analyze-string> would be the thing to use, so I tried:

<!-- I used <xsl:for-each> because <xsl:analyze-string> doesn't allow a 
sequence with more than one item -->
<xsl:for-each 
select="part/section//*[preceding::par[(_at_)class='45_UeberschrPara' and 
contains(., 'In-Kraft-Treten')]]">
        <!-- Until here everything works fine -->
        <xsl:analyze-string select="." regex="\d{4}">
                <!-- No output *sigh*. -->
                <xsl:matching-substring>
                        <xsl:text>Hurra</xsl:text>
                        <xsl:call-template name="get.date">
                                <xsl:with-param name="text" select="."/>
                        </xsl:call-template-->
                </xsl:matching-substring>
        </xsl:analyze-string>
</xsl:for-each> 

As you can see, I tried it with a simplier regualr expression, but with no 
success.
I suppose that the curly bracetts are giving my troubles...
Can you give my a hint, please?

wbr,
Roman

______________________________________

Roman Huditsch
IT and Electronic Publishing
LexisNexis ARD Orac 
Marxergasse 25
1030 Vienna
Austria 
ph: +43-1-534 52-1514
f: +43-1-534 52-140
e-mail roman(_dot_)huditsch(_at_)lexisnexis(_dot_)at
www.lexisnexis.at
 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>