xmlSiteMakerPy
About | How it works | Examples | Download | Author

Examples > Tags
 

You can use in xml content any tags, and write in site-page.xsl section match.

For example there is tag <smile/> -> :).
Xslt:
from site-page.xsl
<xsl:template match="smile" mode="content">
  <xsl:text>:)</xsl:text>
</xsl:template>

Tag <email>: <email>123@123.com</email> -> 123@123.com.
Xslt:
from site-page.xsl
<xsl:template match="email" mode="content">
  <a href="mailto:{.}"><xsl:value-of select="."/></a>
</xsl:template>

There is section tag, f.e.: <section id="idsection" name="Name of Section" level="1"/>
xslt:
from site-page.xsl
<xsl:template match="section" mode="content">
  <a name="{@id}"/>
  <xsl:element name="h{@level}"><xsl:value-of select="@name"/></xsl:element>
</xsl:template>

By tag <sectionList/> you'll get content of page (list of sections).
xslt:
from site-page.xsl
<xsl:template match="sectionList" mode="content">
  <p>
  <xsl:for-each select="/page-of-site/page-content/section">
  <!-- indend before section name -->
  <xsl:choose>
    <xsl:when test="@level = 1"/>
    <xsl:when test="@level = 2">&#160;&#160;</xsl:when>
    <xsl:when test="@level = 3">&#160;&#160;&#160;&#160;</xsl:when>
  </xsl:choose>
  <a href="#{@id}"><xsl:value-of select="@name"/></a><br/>
  </xsl:for-each>
  </p>
</xsl:template>

 

2003, xmlSiteMakerPy, inem@hotbox.ru on top page | Download >>

SourceForge.net Logo