|
Subject: [xsl] [xslt2] matching matches From: Tobias Reif <tobiasreif@xxxxxxxxxxxxx> Date: Mon, 30 Dec 2002 16:18:24 +0100 |
[...] 007 <title>Sirup</title> [...]
to something like this: (output of current state of the templates)
##### (all regexen etc are unfinished) #####
<t:template match="code[@class='screen']">
<t:copy>
<t:for-each select="@*">
<t:copy/>
</t:for-each>
<t:analyze-string select="."
regex="<(\/?)([^\s>\!]+)([^>]+)?>">
<t:matching-substring>
<span class="tag">
<t:text><</t:text>
<t:value-of select="regex-group(1)"/>
<span class="tagname">
<t:value-of select="regex-group(2)"/>
</span>
<!--
returns all attributes, not marked up
<t:value-of select="regex-group(3)"/>
-->
<!--
<t:message>
regex-group(3): <t:value-of select="regex-group(3)"/>
</t:message>
-->
<!-- nothing gets returned here :| -->
<t:call-template name="markup_attributes">
<with-param name="input"
select="regex-group(3)"/>
</t:call-template>
<t:text>></t:text>
</span>
</t:matching-substring>
<t:non-matching-substring>
<t:value-of select="."/>
</t:non-matching-substring>
</t:analyze-string>
</t:copy>
</t:template><t:template name="markup_attributes">
<t:param name="input"/>
<!--
<t:message>
$input: <t:value-of select="$input"/>
</t:message>
-->
<t:analyze-string select="$input"
regex="\s+([^=]+)=">
<t:matching-substring>
<span class="attribute_name">
<t:value-of select="regex-group(1)"/>
<t:text>=</t:text>
</span>
</t:matching-substring>
<t:non-matching-substring>
<t:value-of select="."/>
</t:non-matching-substring>
</t:analyze-string>
</t:template>
##### (end) #####-- http://www.pinkjuice.com/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Partial Matching For, Jarno . Elovirta | Thread | Re: [xsl] [xslt2] matching matches, Jeni Tennison |
| Re: [xsl] RTF Output, Michael Hall | Date | Re: [xsl] [xslt2] matching matches, Jeni Tennison |
| Month |