Top Level Namespace

Defined Under Namespace

Classes: JsTreeBuilder

Constant Summary collapse

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

  <xsl:template match='entries'>

    <xsl:element name='ul'>
      <xsl:attribute name='id'>myUL</xsl:attribute>
      <xsl:apply-templates select='records/link' />
    </xsl:element>

  </xsl:template>

  <xsl:template match='link'>

    <xsl:choose>
      <xsl:when test='records/link'>

        <xsl:element name='li'>

          <xsl:element name='span'>
            <xsl:attribute name="class">caret</xsl:attribute>
            <xsl:choose>
              <xsl:when test='summary/url != ""'>
              <xsl:element name='a'>
                <xsl:attribute name='href'><xsl:value-of select='summary/url'/></xsl:attribute>
                <xsl:value-of select='summary/title'/>
              </xsl:element>
              </xsl:when>
              <xsl:otherwise>
            <xsl:value-of select='summary/title'/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:element>
          <ul class='nested'>
            <xsl:apply-templates select='records/link' />
          </ul>
        </xsl:element>

      </xsl:when>
      <xsl:otherwise>
        <xsl:element name='li'>
          <xsl:choose>
            <xsl:when test='summary/url != ""'>
            <xsl:element name='a'>
              <xsl:attribute name='href'><xsl:value-of select='summary/url'/></xsl:attribute>
              <xsl:value-of select='summary/title'/>
            </xsl:element>
            </xsl:when>
            <xsl:otherwise>
          <xsl:value-of select='summary/title'/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:element>
      </xsl:otherwise>
      </xsl:choose>

  </xsl:template>

</xsl:stylesheet>
]
PLAIN =
%q[
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />

  <xsl:template match='entries'>

    <xsl:element name='ul'>
      <xsl:attribute name='id'>myUL</xsl:attribute>
      <xsl:apply-templates select='records/link' />
    </xsl:element>

  </xsl:template>

  <xsl:template match='link'>

    <xsl:choose>
      <xsl:when test='records/link'>

        <xsl:element name='li'>

          <xsl:choose>
            <xsl:when test='summary/url != ""'>
            <xsl:element name='a'>
              <xsl:attribute name='href'><xsl:value-of select='summary/url'/></xsl:attribute>
              <xsl:value-of select='summary/title'/>
            </xsl:element>
            </xsl:when>
            <xsl:otherwise>
          <xsl:value-of select='summary/title'/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:element>
        <ul>
          <xsl:apply-templates select='records/link' />
        </ul>


      </xsl:when>
      <xsl:otherwise>
        <xsl:element name='li'>
          <xsl:choose>
            <xsl:when test='summary/url != ""'>
            <xsl:element name='a'>
              <xsl:attribute name='href'><xsl:value-of select='summary/url'/></xsl:attribute>
              <xsl:value-of select='summary/title'/>
            </xsl:element>
            </xsl:when>
            <xsl:otherwise>
          <xsl:value-of select='summary/title'/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:element>
      </xsl:otherwise>
      </xsl:choose>

  </xsl:template>

</xsl:stylesheet>
]