Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Besides Dimitre's exact answer, you could use some pattern like in this stylesheet:</p> <pre><code> &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="text"/&gt; &lt;xsl:template match="Client/*" name="space-capital"&gt; &lt;xsl:param name="pLetters" select="translate(name(),'qwertyuiopasdfghjklzxcvbnm','')"/&gt; &lt;xsl:param name="pString" select="name()"/&gt; &lt;xsl:param name="pOut" select="''"/&gt; &lt;xsl:choose&gt; &lt;xsl:when test="$pString != ''"&gt; &lt;xsl:variable name="vFirst" select="substring($pString,1,1)"/&gt; &lt;xsl:call-template name="space-capital"&gt; &lt;xsl:with-param name="pLetters" select="$pLetters"/&gt; &lt;xsl:with-param name="pString" select="substring($pString,2)"/&gt; &lt;xsl:with-param name="pOut" select="concat($pOut, substring(' ',1,contains($pLetters, $vFirst) and $pOut != ''), $vFirst )"/&gt; &lt;/xsl:call-template&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; &lt;xsl:value-of select="concat($pOut,' : ',.,'&amp;#xA;')"/&gt; &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>With this proper input:</p> <pre><code>&lt;ClientArray&gt; &lt;Client&gt; &lt;LastName&gt;Aanonsen&lt;/LastName&gt; &lt;FirstName&gt;Fred&lt;/FirstName&gt; &lt;AdditionalRemarks&gt;Something&lt;/AdditionalRemarks&gt; &lt;/Client&gt; &lt;/ClientArray&gt; </code></pre> <p>Output:</p> <pre><code>Last Name : Aanonsen First Name : Fred Additional Remarks : Something </code></pre> <p>In XPath 2.0:</p> <pre><code>string-join(/*/*/*/concat( (: This is the expression you need :) replace(name(), '(\P{Lu})(\p{Lu})', '$1 $2'), (: the rest is just to mimic the result :) ' : ',.), '&amp;#xA;') </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload