473,545 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Variables in XPath Expression

I have a textBox that contains a string values. I need to take this
string and use it as criteria for an XPath Expression. Here's what I
have. Why isn't it working???

string s = textBox1.Text;
XPathExpression expr;
expr = myXPathNavigato r.Compile("/NewDataSet/note[@to=$s]");

----Matt

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 12 '05 #1
2 1778
what error message show?

"rustyfancy " <ms***@evansvil le-dot-edu.no-spam.invalid> escribió en el
mensaje news:40******** @127.0.0.1...
I have a textBox that contains a string values. I need to take this
string and use it as criteria for an XPath Expression. Here's what I
have. Why isn't it working???

string s = textBox1.Text;
XPathExpression expr;
expr = myXPathNavigato r.Compile("/NewDataSet/note[@to=$s]");

----Matt

----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption

=---
Nov 12 '05 #2
Namespace Manager or XsltContext needed. This query has a prefix,
variable, or user-defined function.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1786
by: axial | last post by:
Is there a way to define a variable by resolving other variables? I'm trying to build an "uber-variable" from user-selected components. I have control over the XML and can change it as needed. The user is allowed to specify one to three data fields from a list and up to three text fields to use as the pattern for creating chapter names: ...
3
1730
by: gimme_this_gimme_that | last post by:
I once downloaded a shareware program that allowed you to open an xml file, click on a text or an attribute, an then see the xpath expression that would fetch that data. The program didn't require that you enter the xpath expression. It may have been something that worked from opening a page in IE. That would be OK. It could have been
3
1621
by: jose.jeria | last post by:
I have the following Code: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes" encoding="UTF-8"/> <xsl:param name="myvar"/>
0
949
by: El Durango | last post by:
I don't know if this is the right area for this post but I have a stylesheet that I use to render XML to another format. At the moment I need to have a variable set to a particular XPath based on a certain test case derived from the XML file. So I would have something like <xsl:template name="A"> <xsl:choose> <xsl:when test="(insert...
1
569
by: rustyfancy | last post by:
I have a textBox that contains a string values. I need to take this string and use it as criteria for an XPath Expression. Here's what I have. Why isn't it working??? string s = textBox1.Text; XPathExpression expr; expr = myXPathNavigator.Compile("/NewDataSet/note"); ----Matt
2
2866
by: ree32 | last post by:
When I import an xml document in Visual studio and Genereate as schema from it, and create a dataset from it, it adds this line into to the root element of my xml file - "xmlns="http://tempuri.org/nameOfRoot.xsd" I have no idea what its pointing to & what is tempuri.org? So when this tag is in my xml tag my xpath query never works. But...
1
421
by: rustyfancy | last post by:
I have a textBox that contains a string values. I need to take this string and use it as criteria for an XPath Expression. Here's what I have. Why isn't it working??? string s = textBox1.Text; XPathExpression expr; expr = myXPathNavigator.Compile("/NewDataSet/note"); ----Matt
6
15492
by: Chua Wen Ching | last post by:
Hi there, I had this xml file with me (not yet consider implementing xml namespaces yet). <?xml version='1.0'?> <Object> <Windows> <EID>1</EID> <EDesc>Error 1</EDesc> </Windows>
4
9107
by: syed.akhlaq | last post by:
Hi, Does anyone know how can I validate XPath expressions using xsd schema? Thanks
4
1542
by: David Schwartz | last post by:
So, I'm having a bit of a time trying to insert an <imgtag into an <atag using an xsl variable. Consider the following template. The contents of the foo variable doesn't show up in the anchor. When I use named entities instead of < and >, it gets inserted just fine although then it's not interpreted by the browser but, rather, simply included...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7757
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3450
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.