Subject: Re: [xsl] Using analyze-string to add tabs From: Michael Kay <mike@xxxxxxxxxxxx> Date: Tue, 20 Sep 2011 12:07:56 +0100 |
Michael Kay Saxonica
Good morning,
I'm just trying to add tabs to the text of certain elements. It seems to be much harder than I anticipated.
Any help would be greatly appreciated.
Thanks, Jeff
Input:
<root>
<ListNumbered aid:pstyle="ListNumbered">1.To access the native file readers menu, navigate to Global Options File Readers.</ListNumbered>
<ListNumbered aid:pstyle="ListNumbered">2.In the Options Editor, expand the File Readers hierarchy on the left, as shown in Figure 2.4.</ListNumbered>
</root>
Desired output:
<root>
<ListNumbered>	1.	To access the native file readers menu, navigate to Global Options File Readers.</ListNumbered>
<ListNumbered>	2	.In the Options Editor, expand the File Readers hierarchy on the left, as shown in Figure 2.4.</ListNumbered>
</root>
XSLT to date, but I'm stumped:
<xsl:for-each select="current-group()">
<xsl:choose>
<xsl:when test="contains(@aid:pstyle, 'ListNumbered')">
<xsl:analyze-string select="." regex="(\d{1,3}\.)(.*?)">
<xsl:matching-substring>
<xsl:text>	</xsl:text><xsl:value-of select="regex-group(1)"/><xsl:text>	</xsl:text><xsl:value-of select="regex-group(2)"/></xsl:element><xsl:text>
</xsl:text>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:when>
<xsl:choose>
</xsl:for-each>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Using analyze-string to a, Andrew Welch | Thread | [xsl] Wrong indentation with javax., Olivier Lefevre |
Re: [xsl] Using analyze-string to a, Andrew Welch | Date | Re: AW: [xsl] format-number trouble, Michael Kay |
Month |