<!--

# =============================================================================

# Copyright © 2016 Typéfi Systems. All rights reserved.

#

# Unless required by applicable law or agreed to in writing, software

# is distributed on an "as is" basis, without warranties or conditions of any

# kind, either express or implied.

# =============================================================================

-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tps="http://www.typefi.com/ContentXML" xmlns:xd="http://www.pnp-software.com/XSLTdoc" version="2.0" exclude-result-prefixes="#all">





    
    <xd:doc type="stylesheet">

        
<xd:short>

            Contains templates in "
<mode>post-processing</mode>" mode that perform CXML-to-CXML conversion to finalize the content.

        
</xd:short>

        
<xd:detail>

            
<p>

                JATS.core contains only implementation of flattening of nested 
<xd:xml><tps:c /></xd:xml> tags in this mode.

            
</p>

            
<p>

                Extend this mode only with features that cannot be easily implemented in the "
<code>#default</code>" mode.

                One of examples of an appropriate usage is repeating of document content twice

                with updating of IDs to keep them unique in the new document.

                Since IDs are generated in many different parts in the "
<code>#default</code>" mode,

                it would be troublesome and redundant to update all of such occasions

                to concatenate a specific prefix to IDs for uniqueness of the repeated content.

            
</p>

        
</xd:detail>

        
<xd:cvsId>   $Revision$</xd:cvsId>

    
</xd:doc>






    
<xsl:template match="tps:c[tps:c]" mode="post-processing">

        
<xsl:for-each-group select="node()" group-adjacent="exists(self::tps:c)">

            
<xsl:choose>

                
<xsl:when test="current-grouping-key()">

                    
<xsl:apply-templates select="current-group()" mode="post-processing" />

                
</xsl:when>



                
<xsl:otherwise>

                    
<tps:c>

                        
<xsl:apply-templates select="../attribute(), current-group()" mode="post-processing" />

                    
</tps:c>

                
</xsl:otherwise>

            
</xsl:choose>

        
</xsl:for-each-group>

    
</xsl:template>



</xsl:stylesheet>













































































v