Login   Register  
PHP Classes
elePHPant
Icontem

File: xmlSiteMaker/content/pages/tags.xml

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ilya Nemihin  >  xmlSiteMaker  >  xmlSiteMaker/content/pages/tags.xml  >  Download  
File: xmlSiteMaker/content/pages/tags.xml
Role: Auxiliary data
Content type: text/plain
Description: xml content
Class: xmlSiteMaker
Offline site generator based on XML
Author: By
Last change:
Date: 11 years ago
Size: 1,721 bytes
 

Contents

Class file image Download
<?xml version="1.0"?>
<page-content>

<p>
You can use in xml content any tags, and write in <code>site-page.xsl</code>
section <code>match</code>.
</p>

<p>
For example there is tag <code>&lt;smile/&gt;</code> -&gt; <smile/>.
<br/>
Xslt:
<source from="site-page.xsl"><![CDATA[
<xsl:template match="smile" mode="content">
  <xsl:text>:)</xsl:text>
</xsl:template>]]>
</source>
</p>

<p>
Tag <code>&lt;email&gt;</code>: <code>&lt;email&gt;123@123.com&lt;/email&gt;</code> -&gt; <email>123@123.com</email>.
<br/>
Xslt:
<source from="site-page.xsl"><![CDATA[
<xsl:template match="email" mode="content">
  <a href="mailto:{.}"><xsl:value-of select="."/></a>
</xsl:template>]]>
</source>
</p>

<p>
There is <code>section</code> tag, f.e.:
<code>&lt;section id="idsection" name="Name of Section" level="1"/&gt;</code>
<br/>xslt:
<source from="site-page.xsl"><![CDATA[
<xsl:template match="section" mode="content">
  <a name="{@id}"/>
  <xsl:element name="h{@level}"><xsl:value-of select="@name"/></xsl:element>
</xsl:template>]]>
</source>
</p>

<p>
By tag <code>&lt;sectionList/&gt;</code> you'll get content of page (list of sections).
<br/>xslt:
<source from="site-page.xsl"><![CDATA[
<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>]]>
</source>
</p>

</page-content>