Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Lloyd 15 posts 35 karma points
    Jun 15, 2011 @ 06:52
    Lloyd
    0

    New schema conversion with next previous links

    I'm converting my macros to the new schema but I'm really struggling with the changes, really struggling. I've got about 7 xslt's to change. Here's one I'm wrestling with right now with the original code

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml
    umbraco.library">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:variable name="currentPosition" select="$currentPage/data [@alias = 'clicheNumber']"/>

    <xsl:template match="/">
    <div class="pagenav">

    <xsl:if test="$currentPage/@sortOrder >= '1' ">
    <xsl:if test="$currentPage/preceding-sibling::node()[1] != '' ">

    <a class="floatleft" href="{umbraco.library:NiceUrl($currentPage/preceding-sibling::node()[1]/@id)}">
    <img src="/media/pagenav_leftarrow.gif" />&nbsp;<xsl:value-of select="$currentPage/preceding-sibling::node()[1]/@nodeName"/>
    </a>

    </xsl:if>
    </xsl:if>

    <xsl:if test="$currentPage/following-sibling::node">
    <xsl:if test="$currentPage/following-sibling::node()[1] != '' ">

    <a class="floatright" href="{umbraco.library:NiceUrl($currentPage/following-sibling::node()[1]/@id)}">
    <xsl:value-of select="$currentPage/following-sibling::node()[1]/@nodeName"/>&nbsp;
    <img src="/media/pagenav_rightarrow.gif" /></a>

    </xsl:if>
    </xsl:if>

    </div>
    </xsl:template>
    </xsl:stylesheet>

    I've made these changes but it's not working so it can't be right.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet
     version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml
    umbraco.library">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:variable name="currentPosition" select="$currentPage/clicheNumber"/>

    <xsl:template match="/">
      <div class="pagenav">
        <xsl:if test="$currentPage/@sortOrder >= '1' ">
          <xsl:if test="$currentPage/preceding-sibling::*[1] != '' ">
            <a class="floatleft" href="{umbraco.library:NiceUrl($currentPage/preceding-sibling::*[1]/@id)}">
              <img src="/media/pagenav_leftarrow.gif" />&nbsp;<xsl:value-of select="$currentPage/preceding-sibling::*[1]/@nodeName"/>
            </a>
          </xsl:if>
        </xsl:if>
        <xsl:if test="$currentPage/following-sibling::*">
          <xsl:if test="$currentPage/following-sibling::*[1] != '' ">
            <a class="floatright" href="{umbraco.library:NiceUrl($currentPage/following-sibling::*[1]/@id)}">
              <xsl:value-of select="$currentPage/following-sibling::*[1]/@nodeName"/>&nbsp;
              <img src="/media/pagenav_rightarrow.gif" /></a>
          </xsl:if>
        </xsl:if>
      </div>
    </xsl:template>
    </xsl:stylesheet>

    Can someone please take a look and point out where I'm going wrong.

  • Lloyd 15 posts 35 karma points
    Jun 15, 2011 @ 23:53
Please Sign in or register to post replies

Write your reply to:

Draft