Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
added 1599 characters in body
Source Link

There are couple of possibilitiesbased on: http://stackoverflow.com/questions/4845660/xsl-how-to-split-strings but the most common is:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:tridion="http://www.xyz.com/tridion/schemas">

<xsl:output method="xml" encoding="utf-8" indent="no"/>

<xsl:template match="tridion:Office/tridion:Telephone/text()" name="split">
    <xsl:param name="pText" select="."/>
    <xsl:if test="string-length($pText)">
        <xsl:if test="not($pText=.)">
            <br />
        </xsl:if>
        <xsl:value-of select="substring-before(concat($pText,','),',')"/>
        <xsl:call-template name="split">
            <xsl:with-param name="pText" select="substring-after($pText, ',')"/>
        </xsl:call-template>
    </xsl:if>
 </xsl:template>         

<!--Identity<xsl:template transform--match="office" >
  <xsl  <h5 id="{@id}">
        <a href="#" property="v:templatename">
 match="@* | node         <xsl:value-of select="name/text()">"/>
        </a>
    </h5>
    <div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Organization">
        <div>
            <p>
                <div class="addressDetails">

                    <xsl:copy>if test="telephone/text()">
                        <div class="moreDetails">
                            <p>
                                <span>
                                    <xsl:applyvalue-templatesof select="@*select="utils:Text('Telephone')"/>
 | node                              </span>
                            </p>
                            <p>

                                <span class="normalfont" property="v:tel">
                                    <xsl:value-of select="telephone/text()"/> 

                                </span>
                            </p>
                            <div class="clearfix">
                                <xsl:comment></xsl:copy>comment>
                            </div>

                        </div>
                    </xsl:template>if>
                </div>
            </p>
        </div>

    </div>
</xsl:stylesheet>template>

</xsl:stylesheet>

There are couple of possibilities: http://stackoverflow.com/questions/4845660/xsl-how-to-split-strings but the most common is:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:tridion="http://www.xyz.com/tridion/schemas">


<xsl:template match="tridion:Office/tridion:Telephone/text()" name="split">
  <xsl:param name="pText" select="."/>
  <xsl:if test="string-length($pText)">
   <xsl:if test="not($pText=.)">
    <br />
   </xsl:if>
   <xsl:value-of select="substring-before(concat($pText,','),',')"/>
   <xsl:call-template name="split">
    <xsl:with-param name="pText" select="substring-after($pText, ',')"/>
   </xsl:call-template>
  </xsl:if>
 </xsl:template>

<!--Identity transform-->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

based on: http://stackoverflow.com/questions/4845660/xsl-how-to-split-strings

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tridion="http://www.xyz.com/tridion/schemas">

<xsl:output method="xml" encoding="utf-8" indent="no"/>

<xsl:template match="tridion:Office/tridion:Telephone/text()" name="split">
    <xsl:param name="pText" select="."/>
    <xsl:if test="string-length($pText)">
        <xsl:if test="not($pText=.)">
            <br />
        </xsl:if>
        <xsl:value-of select="substring-before(concat($pText,','),',')"/>
        <xsl:call-template name="split">
            <xsl:with-param name="pText" select="substring-after($pText, ',')"/>
        </xsl:call-template>
    </xsl:if>
</xsl:template>         

<xsl:template match="office" >
    <h5 id="{@id}">
        <a href="#" property="v:name">
            <xsl:value-of select="name/text()"/>
        </a>
    </h5>
    <div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Organization">
        <div>
            <p>
                <div class="addressDetails">

                    <xsl:if test="telephone/text()">
                        <div class="moreDetails">
                            <p>
                                <span>
                                    <xsl:value-of select="utils:Text('Telephone')"/>
                                </span>
                            </p>
                            <p>

                                <span class="normalfont" property="v:tel">
                                    <xsl:value-of select="telephone/text()"/> 

                                </span>
                            </p>
                            <div class="clearfix">
                                <xsl:comment></xsl:comment>
                            </div>

                        </div>
                    </xsl:if>
                </div>
            </p>
        </div>

    </div>
</xsl:template>

</xsl:stylesheet>

added 790 characters in body
Source Link

There are couple of possibilities: http://stackoverflow.com/questions/4845660/xsl-how-to-split-strings but the most common is:

 <xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">Transform"
 <xslxmlns:output omit-xml-declaration="yes" indent="yes"tridion="http:/>/www.xyz.com/tridion/schemas">

  
<xsl:template match="textmatch="tridion:Office/tridion:Telephone/text()" name="split">
  <xsl:param name="pText" select="."/>
  <xsl:if test="string-length($pText)">
   <xsl:if test="not($pText=.)">
    <br />
   </xsl:if>
   <xsl:value-of select=
    "substringselect="substring-before(concat($pText,','),',')"/>
   <xsl:call-template name="split">
    <xsl:with-param name="pText" select=
     "substringselect="substring-after($pText, ',')"/>
   </xsl:call-template>
  </xsl:if>
 </xsl:template>

<!--Identity transform-->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template> 

</xsl:stylesheet>

There are couple of possibilities: http://stackoverflow.com/questions/4845660/xsl-how-to-split-strings but the most common is:

 <xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output omit-xml-declaration="yes" indent="yes"/>

 <xsl:template match="text()" name="split">
  <xsl:param name="pText" select="."/>
  <xsl:if test="string-length($pText)">
   <xsl:if test="not($pText=.)">
    <br />
   </xsl:if>
   <xsl:value-of select=
    "substring-before(concat($pText,','),',')"/>
   <xsl:call-template name="split">
    <xsl:with-param name="pText" select=
     "substring-after($pText, ',')"/>
   </xsl:call-template>
  </xsl:if>
 </xsl:template>
</xsl:stylesheet>

There are couple of possibilities: http://stackoverflow.com/questions/4845660/xsl-how-to-split-strings but the most common is:

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tridion="http://www.xyz.com/tridion/schemas">

 
<xsl:template match="tridion:Office/tridion:Telephone/text()" name="split">
  <xsl:param name="pText" select="."/>
  <xsl:if test="string-length($pText)">
   <xsl:if test="not($pText=.)">
    <br />
   </xsl:if>
   <xsl:value-of select="substring-before(concat($pText,','),',')"/>
   <xsl:call-template name="split">
    <xsl:with-param name="pText" select="substring-after($pText, ',')"/>
   </xsl:call-template>
  </xsl:if>
 </xsl:template>

<!--Identity transform-->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template> 

</xsl:stylesheet>
Source Link
Loading