473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

XPath problem


Hi,

I am new to XML.
I have the following C# code, which cannot make work:
if (xml.getNodeText("servers:server[servers:name='" + this.cboServers.Text + "']/servers:forums/servers:forum[servers:name=['" + forum + "']", m_ServersDoc) == "1")

I am trying to access the next sibling (called "subscribed") in the following XML file.

<forums>
<forum>
<name>BSIT1</name>
<subscribed>0</subscribed>
</forum>
<forum>

I tried "following-sibling::" but I cannot make it work. Any suggestion?

Mike
Nov 16 '05 #1
3 1127
Mike,

what about...

xml.getNodeText ( "forums/forum/subscribed" );

"Mike" <no****@nospam.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...

Hi,

I am new to XML.
I have the following C# code, which cannot make work:
if (xml.getNodeText("servers:server[servers:name='" + this.cboServers.Text + "']/servers:forums/servers:forum[servers:name=['" + forum + "']", m_ServersDoc) == "1")

I am trying to access the next sibling (called "subscribed") in the following XML file.

<forums>
<forum>
<name>BSIT1</name>
<subscribed>0</subscribed>
</forum>
<forum>

I tried "following-sibling::" but I cannot make it work. Any suggestion?

Mike
Nov 16 '05 #2

Daniel,

I need to find a specific forum. I have a huge list of forums and need XPath to find a specific node.

Mike
"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote in message news:es*************@tk2msftngp13.phx.gbl...
Mike,

what about...

xml.getNodeText ( "forums/forum/subscribed" );

"Mike" <no****@nospam.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...

Hi,

I am new to XML.
I have the following C# code, which cannot make work:
if (xml.getNodeText("servers:server[servers:name='" + this.cboServers.Text + "']/servers:forums/servers:forum[servers:name=['" + forum + "']", m_ServersDoc) == "1")

I am trying to access the next sibling (called "subscribed") in the following XML file.

<forums>
<forum>
<name>BSIT1</name>
<subscribed>0</subscribed>
</forum>
<forum>

I tried "following-sibling::" but I cannot make it work. Any suggestion?

Mike
Nov 16 '05 #3
Try posting at microsoft.public.xml
"Mike" <no****@nospam.com> wrote in message news:e9**************@tk2msftngp13.phx.gbl...

Daniel,

I need to find a specific forum. I have a huge list of forums and need XPath to find a specific node.

Mike


"Daniel Bass" <DanielBass TAKE at OUT CAPS WORDS Postmaster.co.uk> wrote in message news:es*************@tk2msftngp13.phx.gbl...
Mike,

what about...

xml.getNodeText ( "forums/forum/subscribed" );

"Mike" <no****@nospam.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...

Hi,

I am new to XML.
I have the following C# code, which cannot make work:
if (xml.getNodeText("servers:server[servers:name='" + this.cboServers.Text + "']/servers:forums/servers:forum[servers:name=['" + forum + "']", m_ServersDoc) == "1")

I am trying to access the next sibling (called "subscribed") in the following XML file.

<forums>
<forum>
<name>BSIT1</name>
<subscribed>0</subscribed>
</forum>
<forum>

I tried "following-sibling::" but I cannot make it work. Any suggestion?

Mike
Nov 16 '05 #4

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

Similar topics

0
by: gael.pegliasco | last post by:
Hi, How are you dear and nice helper :) ? I'm trying to test xpath with this simple program : import xml.dom.minidom from xml.xpath.Context import Context import xml.xpath
6
by: Ramon M. Felciano | last post by:
Helo all -- I'm trying to gain a deeper understand for what type of semi-declarative programming can be done through XML and XPath/XSLT. I'm looking at graph processing problems as a testbed for...
1
by: Murtaza Tinwala | last post by:
Hi mates, I have the following problem in XSLT. I have following variables: ref-file = <path of XML document> eg "xmlDoc.xml" repeatpath = <a repeat path expressed in Xpath like /root/person >...
4
by: Son KwonNam | last post by:
In XSLT, is this possible to get value from xml using XPath which is in XSLT variable? I mean XPath strings can be dynamic while XSL Transforming. If possible, How?? Because I'm not a...
3
by: Kathy Burke | last post by:
Hi again, I'm using the following xpath (works in visualizer) with a SelectSingleNode("xpath") statement. //Station/(WI])]/@order Problem is I get an error "expression passed to this method...
3
by: muscha | last post by:
Hi All, I have this weird problem. I have an xml document and tried to do an XPath query to it. If I use the SelectSingleNode method it throws an exception but it works with SelectNodes method....
2
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 -...
3
by: abcd_68 | last post by:
Hi there, I'm using, for the first time, the JDK1.5 Xpath API. I need to find elements in a Hibernate-generated .hbm.xml file. These files come with a <!DOCTYPE header mentioning a remote URL....
6
by: J.Marsch | last post by:
I must be completely losing my mind. I have some code that writes to config files. It works great with app.config files, but fails miserably with web.config files. For the life of me, I cannot...
5
by: jorgedelgadolopez | last post by:
Hi all, I am using the xpathnavigator evaluate function on .net (xpath 1 right?). Now I need to expand the code to do multiple contains, compare dates (such as 'before', 'between' and 'after'),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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,...
0
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...

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.