473,503 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with XPath 'substring' function

2 New Member
Hi,

I have a problem with the 'substring' function of XPath in VB.NET (VS 2005).

My code looks like this:
Expand|Select|Wrap|Line Numbers
  1.   dim Dom As new XmlDocument
  2.     Dim mgr As New XmlNamespaceManager(Dom.NameTable)
  3.    'mgr.AddNamespace("fn", "http://www.w3.org/2005/xpath-functions/#substring")
  4.    mgr.AddNamespace("fn", "http://www.w3.org/2005/xpath-functions")
  5.     Dom.Load(fileXml)
  6.    Dim nodeList As XmlNodeList
  7.    Dim root As XmlNode = Dom.DocumentElement
  8.    nodeList = root.SelectNodes("//*[fn:substring(@MittDest,1,1)='a']", mgr)
  9.  
I get the following message (translated from italian)

"XsltContext is necessary for the query due to an unknown function."

Neither of the two AddNameSpace statements works.

Any suggestions?

Thanks
May 17 '10 #1
2 2816
Dormilich
8,658 Recognized Expert Moderator Expert
does it work without the "fn" namespace? (I only used XPath functions in XSLT, but there I didn’t need a namespace)
May 17 '10 #2
pnunbe
2 New Member
@Dormilich
Yes, it does work!

Thanks a lot
May 17 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2890
by: Alexandru | last post by:
Hello fellows. i have a problem with unlink function. if i'm trying to use uplink like this: unlink("../home/meks_party.jpg"); i got the message: Warning: unlink(../home/meks_party.jpg): No...
7
8559
by: Radhika Sambamurti | last post by:
Hi, I've written a substring function. The prototype is: int substr(char s1, char s2) Returns 1 if s2 is a substring of s1, else it returns 0. I have written this program, but Im sure there is an...
4
6053
by: Vitali Gontsharuk | last post by:
Hallo! When using the XPATH document() function to load a new XML document, we are coming across problems, because XALAN seems to have problems with absolute paths. XALAN always assumes that the...
2
4029
by: Michael Dekson | last post by:
In this VB function I have "Run-time error '3151' and debug is located at bold item (-->>). If you know what I do wrong please help me to solve this problem. Thanks
5
9171
by: Shailja | last post by:
Kindly tell me how to use Substring function in VB.
3
5485
by: Rocky86 | last post by:
anybody know how to do a substring function in actionscript pls help~!! I want to do something like extact the number out and convert it to string!
0
1561
by: ponvijaya | last post by:
Hi all, I have used a substring function inside my stored procedre as set @dummy1=substring(@dummyid,2); but when i print and check the value of @dummy1 as select @dummy1;
2
1333
by: Wayne Shu | last post by:
Hi everyone, Today I meet a problem about virtual function. Consider the following little program. #include <iostream> class base { int i;
1
1450
by: john20 | last post by:
Hi All, I am having a problem with accesing function in the page. i have a page say user.aspx in the page load method i am calling function to validate the user. it works fine when single...
6
2415
by: tokcy | last post by:
Hi, I am having a problem with implode() function in PHP. whenever i am running my code it display an error like. Warning: implode() : Bad arguments. in D:\xampp\htdocs\admin\addspecs.php on...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7315
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...
0
7445
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...
0
5559
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,...
1
4991
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...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1492
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 ...
0
369
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...

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.