Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 12th, 2006, 10:37 AM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please help

Need help please. I am getting the below error. But dont seem to undestand why it is coming.

Error
Could not display requested file
Error Number: -2147467259
Error Description: Expected token 'eof' found '='. CurrentPage -->=<-- i

Here is my xml file.

- <Root>
- <Forms>
+ <Form>
+ <Form>
+ <Form>
+ <Form>
  </Forms>
- <Buttons>
  <CurrentPage>1</CurrentPage>
  </Buttons>
  <Records>4</Records>
  <CurrentPage>1</CurrentPage>
  <NoOfPages>1</NoOfPages>
- <Pages>
  <Page>1</Page>
  <CurrentPage>1</CurrentPage>
  <NoOfPages>1</NoOfPages>
  <i>1</i>
  <Category>23</Category>
  </Pages>
  <BeginRecord>1</BeginRecord>
  <EndRecord>4</EndRecord>
  <Category>23</Category>
  </Root>

Here is my xsl file where i am getting the error. I am getting the error at this line "<xsl:when test="CurrentPage = i">". Can anyone please help me.

<tr>
        <td colspan="3">
            <span class="bodycopy02">
            <xsl:value-of select="Records"/> HTML Emails</span>
        </td>
        <td align="right">
            <span class="bodycopy02">
                <xsl:for-each select="Pages">
                    <xsl:choose>
                        <xsl:when test="CurrentPage = i">
                            <b></b>
                            #160;
                        </xsl:when>
                        <xsl:otherwise>

                            #160;
                        </xsl:otherwise>
                    </xsl:choose>

                </xsl:for-each>
            </span>
        </td>
    </tr>



 
Old April 12th, 2006, 10:47 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Please post XML files, e.g. from Notepad, not their view from IE as it's difficult to debug, we have to remove all the + and - signs.

I'm not sure what you are trying to achieve but if i is a variable or a parameter it should be:
Code:
<xsl:when test="CurrentPage = $i">
and if i is a letter (seems odd as you have 1 in the example, it should be:
Code:
<xsl:when test="CurrentPage = 'i'">

--

Joe (Microsoft MVP - XML)
 
Old April 12th, 2006, 12:41 PM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am trying to add paging, but i am getting error in between itself. Hope this helps. Thanks again for your help.

Here is my xml file

- <Root>
- <Forms>
- <Form>
  <Color>#dcdcdc</Color>
  <Login>yes</Login>
  <Profile>yes</Profile>
  <LoginID>akatikan</LoginID>
  <TemplateName>AltA products_submissions2.htm</TemplateName>
  <ChannelID>2</ChannelID>
  <HTMLEmailID>124</HTMLEmailID>
  <FolderID>124</FolderID>
  <FolderName>AltASubmissions</FolderName>
  <FolderPath>..\Emails\AltASubmissions\AltA products_submissions2.htm</FolderPath>
  <ModifyEmails>htmlemails/htmlemail.aspx?FolderID=124</ModifyEmails>
  <CurrentPage>1</CurrentPage>
  </Form>
- <Form>
  <Color>#f5f5f5</Color>
  <Login>yes</Login>
  <Profile>yes</Profile>
  <LoginID>akatikan</LoginID>
  <TemplateName>050317_ira_notification_email.htm</TemplateName>
  <ChannelID>2</ChannelID>
  <HTMLEmailID>120</HTMLEmailID>
  <FolderID>120</FolderID>
  <FolderName>erq2Test1</FolderName>
  <FolderPath>..\Emails\erq2Test1\050317_ira_notific ation_email.htm</FolderPath>
  <ModifyEmails>htmlemails/htmlemail.aspx?FolderID=120</ModifyEmails>
  <CurrentPage>1</CurrentPage>
  </Form>
- <Form>
  <Color>#dcdcdc</Color>
  <Login>yes</Login>
  <Profile>yes</Profile>
  <LoginID>akatikan</LoginID>
  <TemplateName>050317_ira_notification_email.htm</TemplateName>
  <ChannelID>2</ChannelID>
  <HTMLEmailID>125</HTMLEmailID>
  <FolderID>125</FolderID>
  <FolderName>NewTestForMe</FolderName>
  <FolderPath>..\Emails\NewTestForMe\050317_ira_noti fication_email.htm</FolderPath>
  <ModifyEmails>htmlemails/htmlemail.aspx?FolderID=125</ModifyEmails>
  <CurrentPage>1</CurrentPage>
  </Form>
- <Form>
  <Color>#f5f5f5</Color>
  <Login>yes</Login>
  <Profile>yes</Profile>
  <LoginID>akatikan</LoginID>
  <TemplateName>AltA products_submissions2.htm</TemplateName>
  <ChannelID>2</ChannelID>
  <HTMLEmailID>77</HTMLEmailID>
  <FolderID>77</FolderID>
  <FolderName>test11</FolderName>
  <FolderPath>..\Emails\test11\AltA products_submissions2.htm</FolderPath>
  <ModifyEmails>htmlemails/htmlemail.aspx?FolderID=77</ModifyEmails>
  <CurrentPage>1</CurrentPage>
  </Form>
  </Forms>
- <Buttons>
  <CurrentPage>1</CurrentPage>
  </Buttons>
  <Records>4</Records>
  <CurrentPage>1</CurrentPage>
  <NoOfPages>1</NoOfPages>
- <Pages>
  <Page>1</Page>
  <CurrentPage>1</CurrentPage>
  <NoOfPages>1</NoOfPages>
  <i>1</i>
  <Category>23</Category>
  </Pages>
  <BeginRecord>1</BeginRecord>
  <EndRecord>4</EndRecord>
  <Category>23</Category>
  </Root>

And here is my xsl file

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
    <html>
        <xsl:apply-templates/>
    </html>

</xsl:template>

<xsl:template match="Root">
<SCRIPT LANGUAGE="JavaScript">
function DownLoad() {
    var url;
    url = location.href;
    window.open(url, '640x480', '_popup', 'height=640, width=480, scrollbars, left=10, top=10, screenX=10, screenY=10');
}
function FormSubmit() {
    //alert("test");
    document.Next.submit();
}
</SCRIPT>
<table border="0" cellpadding="3" cellspacing="0" width="500">
    <tr>
        <td colspan="3">
            <span class="b02">
            <xsl:value-of select="Records"/> HTML Emails</span>
        </td>
        <td align="right">
            <span class="b02">
                <xsl:for-each select="Pages">
                    <xsl:choose>
                        <xsl:when test="$CurrentPage = $i"> <b><a href="cat_list.asp?paging=next&amp;Category={Categ ory}&amp;Next=++Next++&amp;Page={i}&amp;NextRS={(i * 10) - 10}" onclick="FormSubmit();"><xsl:value-of select="Page" /></a></b>

                            <b></b>
                            #160;
                        </xsl:when>
                        <xsl:otherwise>
                                                        <a href="cat_list.asp?paging=next&amp;Category={Categ ory}&amp;Next=++Next++&amp;Page={i}&amp;NextRS={(i * 10) - 10}"><xsl:value-of select="Page" /></a>

                            #160;
                        </xsl:otherwise>
                    </xsl:choose>

                </xsl:for-each>
            </span>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="left">
            <span class="b02">
            <xsl:value-of select="BeginRecord"/> of
            <xsl:value-of select="EndRecord"/></span>
        </td>
        <td colspan="2" align="right">
            <span class="b02">
            <xsl:value-of select="CurrentPage"/> of
            <xsl:value-of select="NoOfPages"/> Pages</span>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <span class="b03"><br/>
            </span>
        </td>
    </tr>
</table>
<table border="0" cellpadding="3" cellspacing="1" width="500" bgcolor="white">
    <tr bgcolor="#7f0000">
        <td colspan="6"><span class="bodyhead03">HTML Emails</span></td>
    </tr>
    <tr bgcolor="#cccccc">
        <td width="28"></td>
        <td width="300">
            <span class="b02">TemplateName </span>
        </td>
        <!-- <td width="267">
            <span class="b02">Version</span>
        </td>
        <td align="right" width="10">
            <a href="#" onclick="window.open('help/help_forms.html', '_popup', 'height=315, width=315, scrollbars, left=10, top=10, screenX=10, screenY=10');return false">
                <img src="../images/icons_help.gif" width="12" height="12" hspace="1" border="0"/>
            </a>
        </td>-->
        <td align="right" width="65">
            <span class="b02">Options</span>
        </td>


    </tr>
    <xsl:for-each select="Forms">
        <xsl:apply-templates select="Form"/>
    </xsl:for-each>
    <tr align="center">
        <td colspan="5">
            <form name="Next" method="Get" action="cat_list.asp?paging=next">
            <input type="hidden" name="page" value="HTMLEmail" />
            <input type="hidden" name="category">
                <xsl:attribute name="value">
                    <xsl:value-of select="Category"/>
                </xsl:attribute>
            </input>
            <xsl:if test="Buttons/Previous">

                <input type="submit" value="Previous" name="Next" class="b02" />
                <input type="hidden" name="PreviousRS">
                    <xsl:attribute name="value">
                        <xsl:value-of select="Buttons/Previous"/>
                    </xsl:attribute>
                </input>

            </xsl:if>
            <xsl:if test="Buttons/Next">

                <input type="submit" value=" Next " name="Next" class="b02"/>
                <input type="hidden" name="NextRS">
                    <xsl:attribute name="value">
                        <xsl:value-of select="Buttons/Next"/>
                    </xsl:attribute>
                </input>

            </xsl:if>
            </form>
        </td>
    </tr>
</table>
</xsl:template>

<xsl:template match="Form">
<tr>
        <xsl:attribute name="bgcolor">
            <xsl:value-of select="Color"/>
        </xsl:attribute>
        <td width="28">
            <img src="../images/icon_small_web.gif" border="0"/>
        </td>
        <td width="200">
            <span class="b03">
                <xsl:value-of select="FolderName"/>
            </span>
        </td>
        <!-- <td colspan="2">
            <span class="b03">
                <xsl:value-of select="Desc"/>
            </span>
        </td> -->
        <td align="right" width="65">
            <a><xsl:attribute name="href"><xsl:value-of select="FolderPath"/></xsl:attribute><xsl:attribute name="Target">New</xsl:attribute><img src="../images/icons_option_preview.gif" border="0"/></a>
            <a>
                <xsl:attribute name="href">
                    <xsl:value-of select="ModifyEmails"/>
                </xsl:attribute>
                <img src="../images/icons_option_modify.gif" border="0"/>
            </a>
        </td>
    </tr>
</xsl:template>
</xsl:stylesheet>


 
Old April 12th, 2006, 02:40 PM
Authorized User
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you again for all your help.

My problem is fixed. I was using a wrong namespace. I changed it and it is working fine now.










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.