Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


pagination - sort of

From: "Kim" <kim@---.--->
To: NULL
Date: 7/7/2005 2:36:00 PM
I have my xml and xslt below.I am trying to build previous and Next buttons.
these would be dependent on what 'page' I would be on. The value of
'LessontIntro/testContent/tcc/testContentID' defines what Page I am on. The
group of pages would change depending on the value of
'LessontIntro/testContent/tcc/testID'

For the lesson with the testID of 1010
I have 3 Id's 155, 156 and 157



If I am on page 156 - I need to beable to go back to 155 and forward to 157

How do I get the previous and following  testContentID's

See my xslt below

I can restrict it down to the pages in the test - but I cannot figure out
how to get only ONE returened.



<LessonIntro>
    <testContentTypeID>11</testContentTypeID>
    <testContentType>Lesson Intro</testContentType>
    <typeDesc>First Page into the Lesson - Can Be Learner
Objectives</typeDesc>
    <sortOrder>7</sortOrder>
    <testContent>
        <testContentID>114</testContentID>
        <testContentTypeID>11</testContentTypeID>
        <title>INTRO</title>
        <sortOrder>0</sortOrder>
        <parentContentID>0</parentContentID>
            <tcc>
            <testContent_ConnID>51</testContent_ConnID>
            <testContentID>114</testContentID>
            <testID>1009</testID>
            <subPages/>
            </tcc>
     </testContent>
    <testContent>
        <testContentID>115</testContentID>
        <testContentTypeID>11</testContentTypeID>
        <title>INTRO</title>
        <sortOrder>0</sortOrder>
        <parentContentID>0</parentContentID>
            <tcc>
            <testContent_ConnID>51</testContent_ConnID>
            <testContentID>115</testContentID>
            <testID>1009</testID>
            <subPages/>
            </tcc>
     </testContent>
     <testContent>
        <testContentID>155</testContentID>
        <testContentTypeID>11</testContentTypeID>
        <title>INTRO</title>
        <sortOrder>0</sortOrder>
        <parentContentID>0</parentContentID>
            <tcc>
            <testContent_ConnID>51</testContent_ConnID>
            <testContentID>155</testContentID>
            <testID>1010</testID>
            <subPages/>
            </tcc>
     </testContent>
     <testContent>
        <testContentID>156</testContentID>
        <testContentTypeID>11</testContentTypeID>
        <title>INTRO</title>
        <sortOrder>0</sortOrder>
        <parentContentID>0</parentContentID>
            <tcc>
            <testContent_ConnID>51</testContent_ConnID>
            <testContentID>156</testContentID>
            <testID>1010</testID>
            <subPages/>
            </tcc>
     </testContent>
     <testContent>
        <testContentID>157</testContentID>
        <testContentTypeID>11</testContentTypeID>
        <title>INTRO</title>
        <sortOrder>0</sortOrder>
        <parentContentID>0</parentContentID>
            <tcc>
            <testContent_ConnID>51</testContent_ConnID>
            <testContentID>157</testContentID>
            <testID>1010</testID>
            <subPages/>
            </tcc>
     </testContent>



<xsl:template match="text()"/>
<xsl:template match="results/LessonIntro/testContent/tcc/testID">
<xsl:if test="$testContentTypeID ='11'">
<xsl:if test="preceding-sibling::testContentID">
<table border="1">
<tr>
<th>Node name</th>
<th>Node value</th>
</tr>
<xsl:for-each select="preceding-sibling::testContentID[../testID=$testID]">
<tr>
    <td>
        <xsl:value-of select="name()"/>
    </td>
    <td>
        <xsl:value-of select="."/>
    </td>
</tr>
</xsl:for-each>
</table>
</xsl:if>
</xsl:if>
</xsl:template>



Thank you in advance,

 Kim



</LessonIntro>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent