[xsl] Using analyze-string to add tabs

Subject: [xsl] Using analyze-string to add tabs
From: Jeff Wilson <jeffrey@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Sep 2011 01:39:26 -0700
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>&#09;1.&#09;To access the native file readers menu,
navigate to Global Options  File Readers.</ListNumbered>
<ListNumbered>&#09;2&#09;.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>&#09;</xsl:text><xsl:value-of select="regex-group(1)"/
><xsl:text>&#09;</xsl:text><xsl:value-of select="regex-group(2)"/></
xsl:element><xsl:text>&#xA;</xsl:text>
    </xsl:matching-substring>
   </xsl:analyze-string>
  </xsl:when>
 <xsl:choose>
</xsl:for-each>

Current Thread