Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 5th, 2008, 12:21 PM
Registered User
 
Join Date: Feb 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Expression must evaluate to a node-set.

Hi,
i am getting the error Expression must evaluate to a node-set. on the following code
oTrans.SelectSingleNode("File/Result").AppendChild(oTemp.SelectSingleNode("//"))

Reply With Quote
  #2 (permalink)  
Old February 5th, 2008, 01:05 PM
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

I guess you want
  oTemp.SelectSingleNode("//*")
instead of
  oTemp.SelectSingleNode("//")

Reply With Quote
  #3 (permalink)  
Old February 5th, 2008, 01:17 PM
Registered User
 
Join Date: Feb 2008
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i am getting an error
The node to be inserted is from a different document context.
after i changed like this

oTrans.SelectSingleNode("File/Result").AppendChild(oTemp.SelectSingleNode("//*"))

Reply With Quote
  #4 (permalink)  
Old February 5th, 2008, 01:27 PM
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

That does not have anything to do with XSLT.
In some DOM implementations you cannot move nodes from one document to another, you need to use ImportNode or AdoptNode.
So assuming you are using the DOM implementation in .NET try
Code:
oTrans.SelectSingleNode("File/Result").AppendChild(oTrans.ImportNode(oTemp.SelectSingleNode("//"), true))
assuming that oTrans is an XmlDocument, or otherwise
Code:
oTrans.SelectSingleNode("File/Result").AppendChild(oTrans.OwnerDocument.ImportNode(oTemp.SelectSingleNode("//"), true))
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath: set operation with a disjoint node set rich_unger XSLT 7 May 6th, 2008 09:24 AM
substitute text() node value in XPath expression Coolcampers XSLT 4 April 30th, 2008 08:39 AM
Converting String into Node-set dved XSLT 3 January 23rd, 2008 12:40 PM
Filtering out from a node set anothervbaddict XSLT 1 May 22nd, 2007 08:42 AM
node-set function Bernardo Pacheco XSLT 2 June 19th, 2006 10:45 AM



All times are GMT -4. The time now is 09:47 PM.


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