|
|
| laziness, impatience, and hubris | |
| PerlMonks |
To Findout Prime numberby babug_prg (Friar) |
| on Feb 08, 2008 at 06:59 UTC ( #666916=perlquestion: print w/ replies, xml ) | Need Help?? |
|
babug_prg has asked for the
wisdom of the Perl Monks concerning the following question:
<code>
<xsl:template match="PublisherName | PublisherLocation"></xsl:template>
<xsl:template match="Section1/Heading">
► <xsl:variable name="c"> <xsl:value-of select="substring-after(ancestor::Body/preceding-sibling::ChapterInfo/child::ChapterNumber, 'Chapter ')"/> </xsl:variable> <xsl:variable name="cns"> <xsl:value-of select="ancestor::Body/preceding-sibling::ChapterInfo/@NumberingStyle"/> </xsl:variable> <xsl:if test="$cns='ChapterContent'"> <xsl:variable name="possec" select="parent::Section1"/> <xsl:variable name="posc" select="parent::Section1/preceding-sibling::Section1"/> <xsl:value-of select="$c"/>.<xsl:value-of select="count($possec)+count($posc)"/> </xsl:if> <xsl:if test="$cns='ChapterContentSeparately'"> <xsl:variable name="possec" select="parent::Section1"/> <xsl:variable name="posc" select="parent::Section1/preceding-sibling::Section1"/> <xsl:value-of select="count($possec)+count($posc)"/> </xsl:if> <xsl:if test="$cns='ContentOnly'"> <xsl:variable name="possec" select="parent::Section1"/> <xsl:variable name="posc" select="parent::Section1/preceding-sibling::Section1"/> <xsl:value-of select="count($possec)+count($posc)"/> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="Section2/Heading">► <xsl:variable name="c"> <xsl:value-of select="substring-after(ancestor::Body/preceding-sibling::ChapterInfo/child::ChapterNumber, 'Chapter ')"/> </xsl:variable> <xsl:variable name="cns"> <xsl:value-of select="ancestor::Body/preceding-sibling::ChapterInfo/@NumberingStyle"/> </xsl:variable> <xsl:variable name="possec" select="parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:if test="$cns='ChapterContent'"> <xsl:variable name="posc" select="parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section2/preceding-sibling::Section2"/> <xsl:value-of select="$c"/>.<xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/> </xsl:if> <xsl:if test="$cns='ChapterContentSeparately'"> <xsl:variable name="posc" select="parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section2/preceding-sibling::Section2"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/> </xsl:if> <xsl:if test="$cns='ContentOnly'"> <xsl:variable name="posc" select="parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section2/preceding-sibling::Section2"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="Section3/Heading">► <xsl:variable name="c"> <xsl:value-of select="substring-after(ancestor::Body/preceding-sibling::ChapterInfo/child::ChapterNumber, 'Chapter ')"/> </xsl:variable> <xsl:variable name="cns"> <xsl:value-of select="ancestor::Body/preceding-sibling::ChapterInfo/@NumberingStyle"/> </xsl:variable> <xsl:variable name="possec" select="parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:if test="$cns='ChapterContent'"> <xsl:variable name="posc" select="parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section3/preceding-sibling::Section3"/> <xsl:value-of select="$c"/>.<xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/> </xsl:if> <xsl:if test="$cns='ChapterContentSeparately'"> <xsl:variable name="posc" select="parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section3/preceding-sibling::Section3"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/> </xsl:if> <xsl:if test="$cns='ContentOnly'"> <xsl:variable name="posc" select="parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section3/preceding-sibling::Section3"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="Section4/Heading">► <xsl:variable name="c"> <xsl:value-of select="substring-after(ancestor::Body/preceding-sibling::ChapterInfo/child::ChapterNumber, 'Chapter ')"/> </xsl:variable> <xsl:variable name="cns"> <xsl:value-of select="ancestor::Body/preceding-sibling::ChapterInfo/@NumberingStyle"/> </xsl:variable> <xsl:variable name="possec" select="parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:if test="$cns='ChapterContent'"> <xsl:variable name="posc" select="parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section4/preceding-sibling::Section4"/> <xsl:value-of select="$c"/>.<xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/> </xsl:if> <xsl:if test="$cns='ChapterContentSeparately'"> <xsl:variable name="posc" select="parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section4/preceding-sibling::Section4"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/> </xsl:if> <xsl:if test="$cns='ContentOnly'"> <xsl:variable name="posc" select="parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section4/preceding-sibling::Section4"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="Section5/Heading">► <xsl:variable name="c"> <xsl:value-of select="substring-after(ancestor::Body/preceding-sibling::ChapterInfo/child::ChapterNumber, 'Chapter ')"/> </xsl:variable> <xsl:variable name="cns"> <xsl:value-of select="ancestor::Body/preceding-sibling::ChapterInfo/@NumberingStyle"/> </xsl:variable> <xsl:variable name="possec" select="parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:if test="$cns='ChapterContent'"> <xsl:variable name="posc" select="parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section5/preceding-sibling::Section5"/> <xsl:value-of select="$c"/>.<xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/> </xsl:if> <xsl:if test="$cns='ChapterContentSeparately'"> <xsl:variable name="posc" select="parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section5/preceding-sibling::Section5"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/> </xsl:if> <xsl:if test="$cns='ContentOnly'"> <xsl:variable name="posc" select="parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section5/preceding-sibling::Section5"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="Section6/Heading">► <xsl:variable name="c"> <xsl:value-of select="substring-after(ancestor::Body/preceding-sibling::ChapterInfo/child::ChapterNumber, 'Chapter ')"/> </xsl:variable> <xsl:variable name="cns"> <xsl:value-of select="ancestor::Body/preceding-sibling::ChapterInfo/@NumberingStyle"/> </xsl:variable> <xsl:variable name="possec" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:if test="$cns='ChapterContent'"> <xsl:variable name="posc" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section6/parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section6/parent::Section5/preceding-sibling::Section5"/> <xsl:variable name="posc6" select="parent::Section6/preceding-sibling::Section6"/> <xsl:value-of select="$c"/>.<xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/>.<xsl:value-of select="count($posc6)+1"/> </xsl:if> <xsl:if test="$cns='ChapterContentSeparately'"> <xsl:variable name="posc" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section6/parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section6/parent::Section5/preceding-sibling::Section5"/> <xsl:variable name="posc6" select="parent::Section6/preceding-sibling::Section6"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/>.<xsl:value-of select="count($posc6)+1"/> </xsl:if> <xsl:if test="$cns='ContentOnly'"> <xsl:variable name="posc" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section6/parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section6/parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section6/parent::Section5/preceding-sibling::Section5"/> <xsl:variable name="posc6" select="parent::Section6/preceding-sibling::Section6"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/>.<xsl:value-of select="count($posc6)+1"/> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="Section7/Heading">► <xsl:variable name="c"> <xsl:value-of select="substring-after(ancestor::Body/preceding-sibling::ChapterInfo/child::ChapterNumber, 'Chapter ')"/> </xsl:variable> <xsl:variable name="cns"> <xsl:value-of select="ancestor::Body/preceding-sibling::ChapterInfo/@NumberingStyle"/> </xsl:variable> <xsl:variable name="possec" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:if test="$cns='ChapterContent'"> <xsl:variable name="posc" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section7/parent::Section6/parent::Section5/preceding-sibling::Section5"/> <xsl:variable name="posc6" select="parent::Section7/parent::Section6/preceding-sibling::Section6"/> <xsl:variable name="posc7" select="parent::Section7/preceding-sibling::Section7"/> <xsl:value-of select="$c"/>.<xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/>.<xsl:value-of select="count($posc6)+1"/>.<xsl:value-of select="count($posc7)+1"/> </xsl:if> <xsl:if test="$cns='ChapterContentSeparately'"> <xsl:variable name="posc" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section7/parent::Section6/parent::Section5/preceding-sibling::Section5"/> <xsl:variable name="posc6" select="parent::Section7/parent::Section6/preceding-sibling::Section6"/> <xsl:variable name="posc7" select="parent::Section7/preceding-sibling::Section7"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/>.<xsl:value-of select="count($posc6)+1"/>.<xsl:value-of select="count($posc7)+1"/> </xsl:if> <xsl:if test="$cns='ContentOnly'"> <xsl:variable name="posc" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/parent::Section1/preceding-sibling::Section1"/> <xsl:variable name="posc2" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/parent::Section2/preceding-sibling::Section2"/> <xsl:variable name="posc3" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/parent::Section3/preceding-sibling::Section3"/> <xsl:variable name="posc4" select="parent::Section7/parent::Section6/parent::Section5/parent::Section4/preceding-sibling::Section4"/> <xsl:variable name="posc5" select="parent::Section7/parent::Section6/parent::Section5/preceding-sibling::Section5"/> <xsl:variable name="posc6" select="parent::Section7/parent::Section6/preceding-sibling::Section6"/> <xsl:variable name="posc7" select="parent::Section7/preceding-sibling::Section7"/> <xsl:value-of select="count($possec)+1"/>.<xsl:value-of select="count($posc2)+1"/>.<xsl:value-of select="count($posc3)+1"/>.<xsl:value-of select="count($posc4)+1"/>.<xsl:value-of select="count($posc5)+1"/>.<xsl:value-of select="count($posc6)+1"/>.<xsl:value-of select="count($posc7)+1"/> </xsl:if> <xsl:apply-templates/> </xsl:template> <xsl:template match="Para"><xsl:apply-templates/> </xsl:template> <xsl:template match="Literal"><xsl:apply-templates/> <xsl:apply-templates/> </xsl:template> <xsl:template match="Emphasis@Type='Italic'"> <xsl:apply-templates/></xsl:template> <xsl:template match="Emphasis@Type='Italic'"> <xsl:apply-templates/> <xsl:choose> <xsl:when test="following-sibling::Bold"><xsl:apply-templates/></xsl:when> </xsl:choose> </xsl:template> <xsl:template match="Emphasis@Type='Bold'"> <xsl:apply-templates/> <xsl:choose> <xsl:when test="following-sibling::InternalRef1"> </xsl:when> </xsl:choose> </xsl:template> <xsl:template match="Emphasis@Type='BoldItalic'"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Emphasis@Type='SmallCaps'"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Superscript"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Subscript"> <xsl:apply-templates/> </xsl:template> <xsl:template name="c_setRules"> <xsl:choose> <xsl:when test="tgroup/@rowsep='0' and (.//thead/row@rowsep='1' or .//tfooter/row@rowsep='1')"> <xsl:attribute name="RULES">groups</xsl:attribute> <xsl:attribute name="cellpadding">5</xsl:attribute> </xsl:when> <xsl:when test="tgroup/@colsep='1' and tgroup/@rowsep='0'"> <xsl:attribute name="RULES">cols</xsl:attribute> <xsl:attribute name="cellpadding">5</xsl:attribute> </xsl:when> <xsl:when test="tgroup/@colsep='0' and tgroup/@rowsep='0'"> <xsl:attribute name="RULES">none</xsl:attribute> <xsl:attribute name="cellpadding">5</xsl:attribute> </xsl:when> <xsl:when test="tgroup/@colsep='0' and tgroup/@rowsep='1'"> <xsl:attribute name="RULES">rows</xsl:attribute> <xsl:attribute name="cellpadding">4</xsl:attribute> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="entry" mode="getClass"> <xsl:variable name="needsColSep"><xsl:apply-templates select="." mode="needsColSep"/></xsl:variable> <xsl:variable name="needsRowSep"><xsl:apply-templates select="." mode="needsRowSep"/></xsl:variable> <xsl:variable name="colSep"><xsl:if test="$needsColSep = '1'"><xsl:text>rightBorder</xsl:text></xsl:if></xsl:variable> <xsl:variable name="rowSep"><xsl:if test="$needsRowSep = '1'"><xsl:text>bottomBorder</xsl:text></xsl:if></xsl:variable> <xsl:variable name="thead"><xsl:if test="parent::row/parent::thead"><xsl:text>thead</xsl:text></xsl:if></xsl:variable> <xsl:variable name="styles"> <xsl:value-of select="concat($colSep, ' ', $rowSep, ' ', $thead)"/> </xsl:variable> <xsl:value-of select="$styles"/> </xsl:template> <xsl:template match="entry" mode="needsColSep"> <xsl:variable name="colID"><xsl:value-of select="@colname"/></xsl:variable> <xsl:choose> <xsl:when test="(@colsep = '1') or (not(@colsep) and ancestor::tgroup/colspec(@colnum = $colID) and @colsep = '1') or (not(@colsep) and ancestor::tgroup/colspec(@colnum = $colID) and not(@colsep))"> <xsl:value-of select="'1'"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="'0'"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="entry" mode="needsRowSep"> <xsl:choose> <xsl:when test="(@rowsep = '1') or (not(@rowsep) and parent::row@rowsep = '1')"> <xsl:value-of select="'1'"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="'0'"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="c_TableColspan1"> <xsl:variable name="vartgroup" select="ancestor::tgroup"/> <xsl:variable name="varspanspec" select="$vartgroup/spanspec@spanname=current()/@spanname"/> <xsl:if test="$varspanspec/@namest and $varspanspec/@nameend"> <xsl:variable name="varcolumnst" select="$vartgroup/colspec@colname=$varspanspec/@namest/@colnum"/> <xsl:variable name="varcolumnend" select="$vartgroup/colspec@colname=$varspanspec/@nameend/@colnum"/> <xsl:choose> <xsl:when test="$varcolumnst and $varcolumnend"><xsl:value-of select="$varcolumnend - $varcolumnst + 1"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> <xsl:template name="c_TableColspan2"> <xsl:variable name="vartgroup" select="ancestor::tgroup"/> <xsl:variable name="varspanspec" select="current()"/> <xsl:if test="$varspanspec/@namest and $varspanspec/@nameend"> <xsl:variable name="varcolumnst" select="$vartgroup/colspec@colname=$varspanspec/@namest/@colnum"/> <xsl:variable name="varcolumnend" select="$vartgroup/colspec@colname=$varspanspec/@nameend/@colnum"/> <xsl:choose> <xsl:when test="$varcolumnst and $varcolumnend"><xsl:value-of select="$varcolumnend - $varcolumnst + 1"/></xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> <xsl:template name="c_TableTR"> <xsl:if test="../@align"><xsl:attribute name="align"><xsl:value-of select="../@align"/></xsl:attribute></xsl:if> <xsl:choose> <xsl:when test="../@valign"><xsl:attribute name="valign"><xsl:value-of select="../@valign"/></xsl:attribute></xsl:when> <xsl:when test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign"/></xsl:attribute></xsl:when> </xsl:choose> <xsl:if test="@align"><xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute></xsl:if> </xsl:template> <xsl:template name="c_TableTD"> <xsl:variable name="colname"><xsl:value-of select="@colname"/></xsl:variable> <xsl:variable name="styles"> <xsl:variable name="temp"><xsl:apply-templates select="." mode="getClass"/></xsl:variable> <xsl:value-of select="normalize-space($temp)"/> </xsl:variable> <xsl:variable name="colWidth"> <xsl:choose> <xsl:when test="@colwidth"><xsl:value-of select="@colwidth"/></xsl:when> <xsl:otherwise><xsl:value-of select="ancestor::tgroup/colspec@colnum = $colname/@colwidth"/></xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="width"><xsl:value-of select="$colWidth"/></xsl:variable> <xsl:if test="$styles != ''"><xsl:attribute name="class">docTableCell <xsl:value-of select="$styles"/></xsl:attribute></xsl:if> <xsl:choose> <xsl:when test="@align"> <xsl:attribute name="align"><xsl:value-of select="@align"/></xsl:attribute></xsl:when> <xsl:when test="ancestor::tgroup/@align"><xsl:attribute name="align"><xsl:value-of select="ancestor::tgroup/@align"/></xsl:attribute></xsl:when> </xsl:choose> <xsl:if test="@valign"><xsl:attribute name="valign"><xsl:value-of select="@valign"/></xsl:attribute></xsl:if> <xsl:if test="@morerows"><xsl:attribute name="rowspan"><xsl:value-of select="@morerows + 1"/></xsl:attribute></xsl:if> <xsl:if test="@spanname"><xsl:attribute name="colspan"><xsl:call-template name="c_TableColspan1"/></xsl:attribute></xsl:if> <xsl:if test="@namest"><xsl:attribute name="colspan"><xsl:call-template name="c_TableColspan2"/></xsl:attribute></xsl:if> <xsl:choose> <xsl:when test="child::text()"><xsl:apply-templates select="."/></xsl:when> <xsl:when test="child::*"><xsl:apply-templates/></xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="c_Table">
<xsl:apply-templates select="creditline"/> </xsl:if> <xsl:if test="source"><xsl:apply-templates select="source"/> </xsl:if> <xsl:if test="mediaobject/textobjectnot(@role='alt')"> <xsl:apply-templates select="mediaobject/textobjectnot(@role='alt')"/> </xsl:if><xsl:for-each select=".//footnote"><xsl:apply-templates/></xsl:for-each> </xsl:template> <xsl:template name="c_Tablefooter"> <xsl:for-each select="tfooter/SimplePara"> <xsl:text>Tfooter </xsl:text><xsl:apply-templates/> </xsl:for-each> </xsl:template> <xsl:template name="c_colwidth"> <xsl:param name="attrval"/> <xsl:value-of select="round($attrval)"/> </xsl:template> <xsl:template match="entry"> <xsl:choose> <xsl:when test="*"><xsl:apply-templates/></xsl:when> <xsl:when test="normalize-space(.)=''"> </xsl:when> <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="//Chapter/ChapterInfo/ChapterCopyright/CopyrightHolderName"></xsl:template> <xsl:template match="//Chapter/ChapterInfo/ChapterCopyright/CopyrightYear"></xsl:template> <xsl:template match="//Part">PartInfo <xsl:apply-templates/><xsl:text>PartID</xsl:text> |
<xsl:apply-templates/> | <xsl:text>PartNumber</xsl:text> |
<xsl:apply-templates/> | <xsl:text>PartSequenceNumber</xsl:text> |
<xsl:apply-templates/> | <xsl:text>PartTitle</xsl:text> |
<xsl:apply-templates/> | <xsl:text>PartChapterCount</xsl:text> |
<xsl:apply-templates/> | <xsl:text>PartContext-BookID</xsl:text> |
<xsl:apply-templates/> | <xsl:text>PartContext-BookTitle</xsl:text> |
<xsl:apply-templates/> | Colophon <xsl:apply-templates/></xsl:template> <xsl:template match="//ChapterBackmatter/*position()=last()"> <xsl:apply-templates/> © Integra Software Services Pvt. Ltd. All rights reserved. </xsl:template> </xsl:stylesheet> [/Springer_FT.xsl] [springer.xsl] <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://dtd.cambridge.org/2002/CamML-content"> <xsl:variable name="uc" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/> <xsl:variable name="lc" select="'abcdefghijklmnopqrstuvwxyz'"/> <xsl:variable name="cc" select="'col'"/> <xsl:variable name="c" select="''"/> <xsl:variable name="xlh" select="'#'"/> <xsl:variable name="xlv" select="''"/> <xsl:template match="/"><xsl:apply-templates/></xsl:template> <xsl:template match="text()"><xsl:value-of select="."/></xsl:template> <xsl:template match="Publisher">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="Series">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="Book">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="Part">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="Chapter">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="BodyRef">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="//*/ChapterCopyright/CopyrightYear|//*/ChapterCopyright/CopyrightHolderName|//*/PublisherName|//*/PublisherLocation|//*/SeriesID|//*/SeriesPrintISSN|//*/SeriesTitle|//*/BookID|//*/BookTitle|//*/BookVolumeNumber|//*/BookDOI|//*/BookTitleID|//*/BookPrintISBN|//*/BookElectronicISBN|//*/BookChapterCount|//*/CopyrightHolderName|//*/CopyrightYear|ChapterID|ChapterNumber|ChapterSequenceNumber|//*/ChapterTitle|//*/ChapterFirstPage|//*/ChapterLastPage|//*/BookBackmatterFirstPage|//*/BookBackmatterLastPage|//*/BookFrontmatterFirstPage|//*/BookFrontmatterLastPage|//*/BookSubTitle|//*/PartChapterCount|//*/PartSubTitle|//*/PartTitle|//*/PartNumber|//*/PartSequenceNumber|//*/PartID|//*/ChapterSubTitle|//*/SeriesAbbreviatedTitle|//*/SeriesSubTitle"></xsl:template>
<xsl:template match="SeriesHeader">
Series Header<xsl:apply-templates/> </xsl:template> <xsl:template match="BookHeader"> Book Header<xsl:apply-templates/> </xsl:template> <xsl:template match="PartHeader"> Part Header<xsl:apply-templates/> </xsl:template> <xsl:template match="ChapterHeader"> Chapter Header<xsl:apply-templates/> </xsl:template> <xsl:template match="EditorGroup">Editor Group <xsl:apply-templates/></xsl:template> <xsl:template match="AuthorGroup">Author Group <xsl:apply-templates/></xsl:template> <xsl:template match="Editor|Author"> <xsl:attribute name="href">#<xsl:value-of select="@AffiliationIDS"/></xsl:attribute> <xsl:apply-templates/> </xsl:template> <xsl:template match="Editor/EditorName|Author|AuthorName"> <xsl:apply-templates/> </xsl:template> <xsl:template match="GivenName"> <xsl:apply-templates/></xsl:template> <xsl:template match="GivenName1"><xsl:apply-templates/></xsl:template> <xsl:template match="FamilyName"> <xsl:apply-templates/></xsl:template> <xsl:template match="Suffix"> <xsl:apply-templates/></xsl:template> <xsl:template match="Affiliation"> <xsl:attribute name="name"><xsl:value-of select="@ID"/></xsl:attribute>
Organisation Name: <xsl:apply-templates/> </xsl:template> <xsl:template match="OrgDivision">Organisation Division: <xsl:apply-templates/> </xsl:template> <xsl:template match="OrgAddress/Street">Street: <xsl:apply-templates/> </xsl:template> <xsl:template match="OrgAddress/City">City: <xsl:apply-templates/> </xsl:template> <xsl:template match="OrgAddress/State">State: <xsl:apply-templates/> </xsl:template> <xsl:template match="OrgAddress/Country">Country: <xsl:apply-templates/> </xsl:template> <xsl:template match="Bibliography"><xsl:apply-templates/> </xsl:template> <xsl:template match="Heading"> <xsl:apply-templates/></xsl:template> <xsl:template match="Citation"> <xsl:value-of select="@ID"/><xsl:apply-templates/> </xsl:template> <xsl:template match="Citation/*/ArticleTitle"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="Citation/*/BookTitle"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="Citation/*/ChapterTitle"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="BibAuthorName"> <xsl:apply-templates select="FamilyName"/>, <xsl:apply-templates select="Initials"/> </xsl:template> <xsl:template match="BibAuthorName/Initials"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="BibAuthorName/FamilyName"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="InstitutionalAuthorName"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="BibEditorName"> <xsl:apply-templates/> </xsl:template> <xsl:template match="BibEditorName/Initials"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="BibEditorName/FamilyName"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="Citation/*/PublisherName"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="Citation/*/PublisherLocation"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="JournalTitle"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="Year"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> (<xsl:apply-templates/>) <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="VolumeID"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="IssueID"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:apply-templates/> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> <xsl:template match="FirstPage"> <xsl:apply-templates/> </xsl:template> <xsl:template match="BibUnstructured"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Emphasis@Type='Italic'"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Superscript"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Subscript"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Particle"> <xsl:text> </xsl:text><xsl:apply-templates/> </xsl:template> <xsl:template match="Prefix"> <xsl:apply-templates/><xsl:text> </xsl:text> </xsl:template> <xsl:template match="LastPage"> -<xsl:apply-templates/> </xsl:template> <xsl:template match="Eds"> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\starttag.gif"></img> <xsl:if test="count(preceding-sibling::BibEditorName) > 1">(Eds.)</xsl:if> <xsl:if test="count(preceding-sibling::BibEditorName) = 1">(Ed.)</xsl:if> <img src="D:\Springer_FullText\Demo_FIles_Preparation\Springer_Header_References\Tools\endtag.gif"></img> </xsl:template> </xsl:stylesheet> [/springer.xsl] [check.ent] <!ENTITY ape "≊" > <!ENTITY apE "≊" > <!ENTITY apid "≋" > <!ENTITY asymp "≍" > <!ENTITY bcong "≌" > <!ENTITY bepsi "" > <!ENTITY bowtie "⋈" > <!ENTITY bsim "∽" > <!ENTITY bsime "⋍" > <!ENTITY bsolhsub "" > <!ENTITY bump "≎" > <!ENTITY bumpe "≏" > <!ENTITY bumpE "" > <!ENTITY Barv "" > <!ENTITY cire "≗" > <!ENTITY colone "≔" > <!ENTITY congdot "" > <!ENTITY csub "" > <!ENTITY csube "" > <!ENTITY csup "" > <!ENTITY csupe "" > <!ENTITY Cuepr "⋞" > <!ENTITY cuesc "⋟" > <!ENTITY Colon "∷" > <!ENTITY Colone "" > <!ENTITY dashv "⊣" > <!ENTITY Dashv "" > <!ENTITY easter "≛" > <!ENTITY ecir "≖" > <!ENTITY ecolon "≕" > <!ENTITY eDDot "" > <!ENTITY eDot "≑" > <!ENTITY efDot "≒" > <!ENTITY eg "" > <!ENTITY egs "⋝" > <!ENTITY egsdot "" > <!ENTITY el "" > <!ENTITY els "⋜" > <!ENTITY elsdot "" > <!ENTITY equest "≟" > <!ENTITY equivDD "" > <!ENTITY erDot "≓" > <!ENTITY esdot "≐" > <!ENTITY esim "≂" > <!ENTITY Esim "" > <!ENTITY fork "⋔" > <!ENTITY forkv "" > <!ENTITY frown "⌢" > <!ENTITY gap "≳" > <!ENTITY gel "⋛" > <!ENTITY ges "" > <!ENTITY gescc "" > <!ENTITY gesdot "" > <!ENTITY gesdoto "" > <!ENTITY gesdotol "" > <!ENTITY gesl "" > <!ENTITY gesles "" > <!ENTITY gE "≧" > <!ENTITY gEl "⋛" > <!ENTITY gl "≷" > <!ENTITY gla "" > <!ENTITY glE "" > <!ENTITY glj "" > <!ENTITY gsim "≳" > <!ENTITY gsime "" > <!ENTITY gsiml "" > <!ENTITY gtcc "" > <!ENTITY gtcir "" > <!ENTITY gtdot "⋗" > <!ENTITY gtquest "" > <!ENTITY gtrarr "" > <!ENTITY Gg "⋙" > <!ENTITY Gt "≫" > <!ENTITY homtht "∻" > <!ENTITY lap "≲" > <!ENTITY lat "" > <!ENTITY late "" > <!ENTITY lates "" > <!ENTITY leg "⋚" > <!ENTITY les "" > <!ENTITY lescc "" > <!ENTITY lesdot "" > <!ENTITY lesdoto "" > <!ENTITY lesdotor "" > <!ENTITY lesg "" > <!ENTITY lesges "" > <!ENTITY lE "≦" > <!ENTITY lEg "⋚" > <!ENTITY lg "≶" > <!ENTITY lgE "" > <!ENTITY lsim "≲" > <!ENTITY lsime "" > <!ENTITY lsimg "" > <!ENTITY ltcc "" ><!--UE35
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||