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 October 10th, 2006, 08:29 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default NodeTest expected here??

Hi, I have a question that I hope you may shed some light on:

The following line when processed in XMLspy to html returns all the values:

    <xsl:for-each select="document(@loc)/id(@item)">

however when I process through Internet explorer I add this line to the XML file:

<?xml-stylesheet type="text/xsl" href="MEL3.xslt"?>

when proceesed I receive the following error.

NodeTest expected here. document(@loc)/-->id<--(current()/@item)

When I try this line:

<xsl:for-each select="document(@loc)/*[id(@item)]">

I recieve no errors but no values are returned.
I am using XSLT 2.0 - Thanks for the help.
 
Old October 11th, 2006, 05:18 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The construct document(x)/id(y) is allowed in XSLT 2.0 but not in XSLT 1.0. The XSLT processor in Internet Explorer is a 1.0 processor.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old October 11th, 2006, 05:55 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thank you Michael,

Do you suggested any work around? I use the Document() a lot and i want to process the information live. Using XMLspy I would process in 2.0 and have to save the HTML document. I want the user to click the XML file and it process to HTML.

Any suggestions would be greatly appreciated.
Thanks,



 
Old October 11th, 2006, 06:02 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

In 1.0 the normal workaround is along the lines

<xsl:for-each select="document(x)">
    .... select="id(y)"
</xsl:for-each>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
expected Then Adam H-W Classic ASP Basics 6 April 17th, 2008 05:41 AM
expected ';' RoniR Javascript 3 February 1st, 2007 05:28 AM
too few parameters expected n desprate Access VBA 6 April 29th, 2005 06:33 AM
Expected 'Then' Adam H-W Classic ASP Basics 5 July 26th, 2004 02:36 PM





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