Subject: Re: [xsl] How to output the characters denoted by the regex \p{P} From: "Pieter Masereeuw pieter@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 28 Feb 2025 12:39:57 -0000 |
On 28/02/2025 12:50, Roger L Costello costello@xxxxxxxxx wrote:Hi Folks,
In XML Schema \p{P} denotes the set of punctuation characters.
Is there a way in XSLT to output (display) the characters denoted by \p{P}
With "brute force", like this, perhaps?
\xA0 <xsl:template match="/" name="xsl:initial-template">
\xA0\xA0\xA0 <html>
\xA0\xA0\xA0\xA0\xA0 <head>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <title>Test of puncation chars</title>
\xA0\xA0\xA0\xA0\xA0 </head>
\xA0\xA0\xA0\xA0\xA0 <body>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <table>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <thead>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <tr>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <th>Unicode</th>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <th>Character</th>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </tr>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </thead>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <tbody>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <xsl:for-each select="1 to 1114111">
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <xsl:try>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <xsl:variable name="char" select="codepoints-to-string(.)"/>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <xsl:if test="matches($char, '\p{P}')">
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <tr>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <td>{.}</td>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <td>{$char}</td>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </tr>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </xsl:if>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 <xsl:catch/>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </xsl:try>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </xsl:for-each>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </tbody>
\xA0\xA0\xA0\xA0\xA0\xA0\xA0 </table>
\xA0\xA0\xA0\xA0\xA0 </body>
\xA0\xA0\xA0 </html>
\xA0 </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to output the charact, Martin Honnen martin | Thread | Re: [xsl] How to output the charact, Roger L Costello cos |
Re: [xsl] How to output the charact, Martin Honnen martin | Date | Re: [xsl] How to output the charact, Roger L Costello cos |
Month |