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 September 29th, 2006, 05:26 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

No luck... I am still recieving the same error.


 
Old September 29th, 2006, 05:46 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>No luck... I am still recieving the same error.

Are you wanting any more help? If so, you need to show what you are doing and what error you are getting. This has been a pretty tortuous thread and you can't expect anyone to know where you've got to.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old September 29th, 2006, 07:07 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

Yes I still need help. I appreciate your time and effort to help me.



Here is my code that I am using:

Code:
  <xsl:template match="JBU:share">
    <xsl:variable name="x" select="@item" >
      <xsl:for-each select="document(@loc)">
        <xsl:apply-templates select="id($x)/node()"/>
      </xsl:for-each>
    </xsl:variable>
  </xsl:template>


I am recieving the following error:

The variable or parameter 'x' cannot have both a 'select' attribute and non-empty content.

The JBU:share has two attributes, @loc and @item. @loc is for the location of the xml document and @item is the id I want the value of.

The @item is not empty. I need that value to identify the id of the element I need the value of.

Regards,
Bones


 
Old September 30th, 2006, 02:39 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your code should be

<xsl:template match="JBU:share">
    <xsl:variable name="x" select="@item" />
    <xsl:for-each select="document(@loc)">
        <xsl:apply-templates select="id($x)/node()"/>
    </xsl:for-each>
  </xsl:template>

I'm surprised that you're having trouble with something so basic. I'd suggest you get a book such as Jeni Tennison's "Beginning XSLT" and work your way through the examples and exercises.

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
xpath contains error 'has an invalid token' XMLUser XSLT 7 February 5th, 2008 02:31 AM
XPath Error tclotworthy XSLT 4 March 1st, 2007 07:20 PM
XPath API and DOM Document object nnravi XML 10 May 2nd, 2006 12:24 PM
XSLT -XPATH Error xslspy XSLT 1 October 27th, 2005 03:24 AM
XPath Evaluate Document safin XML 2 September 19th, 2005 07:29 AM





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