Subject: Re: [xsl] Ungready Flag on Regex From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 22 Oct 2020 21:53:36 -0000 |
I think the issue is your use of text value templates
<xsl:non-matching-substring>{pt:replaceTextArobase(.)}</xsl:non-matching-subs tring>
that strips any elements; you need to use B <xsl:non-matching-substring> B B B <xsl:sequence select="pt:replaceTextArobase(.)"/> B </xsl:non-matching-substring>
<xsl:function name="pt:replaceTextMarkers" as="item()+"> <xsl:param name="s" as="xs:string"/> <xsl:analyze-string select="$s" regex="\*\*(.*?)\*\*"> <xsl:matching-substring><text:span text:style-name="TB">{pt:replaceTextDollar(substring(.,3, string-length(.)-4))}</text:span></xsl:matching-substring> <xsl:non-matching-substring> <xsl:sequence select="pt:replaceTextDollar(.)"/> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:function>
<xsl:function name="pt:replaceTextDollar" as="item()+"> <xsl:param name="s" as="xs:string"/> <xsl:analyze-string select="$s" regex="\$\$(.*?)\$\$"> <xsl:matching-substring><text:span text:style-name="TCode"><xsl:sequence select="pt:replaceTextArobase(substring(.,3, string-length(.)-4))"/></text:span></xsl:matching-substring> <xsl:non-matching-substring><xsl:sequence select="pt:replaceTextArobase(.)"/></xsl:non-matching-substring> </xsl:analyze-string> </xsl:function>
<xsl:function name="pt:replaceTextArobase" as="item()+"> <xsl:param name="s" as="xs:string"/> <xsl:analyze-string select="$s" regex="@@(.*?)@@"> <xsl:matching-substring><text:span text:style-name="TLink"><xsl:sequence select="substring(.,3, string-length(.)-4)"/></text:span></xsl:matching-substring> <xsl:non-matching-substring>{.}</xsl:non-matching-substring> </xsl:analyze-string> </xsl:function>
<xsl:function name="pt:unescapeSpecialChars" as="xs:string"> <xsl:param name="s" as="xs:string"/> <xsl:sequence select="$s=>replace('\*', '*', 'q')=>replace('\$', '$', 'q')=>replace('\@','@', 'q')"/> </xsl:function>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Ungready Flag on Regex, Martin Honnen martin | Thread | Re: [xsl] Ungready Flag on Regex, Christophe Marchand |
Re: [xsl] Ungready Flag on Regex, Martin Honnen martin | Date | Re: [xsl] Ungready Flag on Regex, Christophe Marchand |
Month |