473,588 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XPathNodeIterat or.Current.GetA ttribute


XPathNodeIterat or.Current.GetA ttribute(localN ame As String, namespaceURI As
String)

i believe that localName should be set equal to the name of the attribute.

but what should namespaceURI be set equal to ?
Nov 12 '05 #1
3 10090
John A Grandy wrote:
XPathNodeIterat or.Current.GetA ttribute(localN ame As String, namespaceURI As
String)

i believe that localName should be set equal to the name of the attribute.

but what should namespaceURI be set equal to ?


To namespace URI if the attribute belongs to a namespace. E.g.

<foo xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "foo.xsd">b ar</foo>

Here to get xsi:noNamespace SchemaLocation attribute value you can use

string schema = ni.Current.GetA ttribute("noNam espaceSchemaLoc ation",
"http://www.w3.org/2001/XMLSchema-instance");
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2
what if i'm just loading out of a self-created xml doc in the local file
system ?

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!P LEASEtkachenko. com> wrote in message
news:OR******** ******@TK2MSFTN GP12.phx.gbl...
John A Grandy wrote:
XPathNodeIterat or.Current.GetA ttribute(localN ame As String, namespaceURI As String)

i believe that localName should be set equal to the name of the attribute.
but what should namespaceURI be set equal to ?


To namespace URI if the attribute belongs to a namespace. E.g.

<foo xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "foo.xsd">b ar</foo>

Here to get xsi:noNamespace SchemaLocation attribute value you can use

string schema = ni.Current.GetA ttribute("noNam espaceSchemaLoc ation",
"http://www.w3.org/2001/XMLSchema-instance");
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com

Nov 12 '05 #3
John A Grandy wrote:
what if i'm just loading out of a self-created xml doc in the local file
system ?


And what?

You mean you don't know attribute name and namespace? Then use
MoveToFirstAttr ibute() and MoveToNextAttri bute() methods to navigate
through attributes.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #4

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

Similar topics

0
1387
by: Ilian Nilsson | last post by:
Hi Al If I try to use the following code lines in an recursive (recurse down in Xml tree) manner the XPathNodeIterator gets reset in it's parent method call, which will end up in that all nodes wont be hit. Why is that? Im using 1.1 Framework. If i create an ArrayList containing the nodes from the Iterator and use foreach (instead of the iterator) then it works SomeFunction(oRootNode, "*" Private SomeFunction(aoBaseNode As XmlNode,...
2
3580
by: avnrao via .NET 247 | last post by:
Hi, please clarify this doubt about XPathNodeIterator..the following XSLT uses this.. my doubt is, by looking at the XSLT, i thought the output to be Book1..but the actual output is Book1Book2Book3Book4.. as I understand, func method is called only once and XPathNodeIterator.MoveNext() is called only once..and how is this concatenated output?? tia, avnrao.
2
4543
by: Emmanuel | last post by:
Hi, I am writing an ASP.NET web applications which uses an xml file to display html content on the web pages. My problem is that using the Value property of the current object of the XPathNodeIterator cuts out the embedded html tags. How can I, using an XPathNodeIterator, output the entire contents of a node even if it has child nodes?
4
1718
by: Jamie da Silva | last post by:
I couldn't find a better resource for reporting a possible .NET Framework 1.1 (SP0 & 1) bug, so if this is not the proper forum, please let me know. The problem appears to occur when using "self::" to match the current node of an XPathNavigator. In this case the resulting XPathNodeIterator returns a Count of 1 even though it is properly empty as evidenced by MoveNext() returning false. In the following sample code (compiled as a...
3
5315
by: KJ | last post by:
It is true that there is no way to get the outerXml of XPathNodeIterator.Current? Please say it isn't so.
0
947
by: David | last post by:
I'm using an XPathNodeIterator to select an element in an XML document that contains text I am going to put in a label on an aspx page. I want to be able to include HTML tags in the text read from the XML document, but the XPathNodeIterator.Current.Value property seems to ignore any tags. The text inside the tags is included, but the formatting is not. Is this possible or is there something else I need to do?
2
3798
by: Volkan | last post by:
Hi, I'm trying to compare two XML documents and i'm using XPath queries to select nodes. XPathNavigator's Select method runs fast enough and returns an XPathNodeIterator object. When i try to access this iterator's Count property the process extremely slows down. If i just iterate throgh 18.000 nodes and call XPathNavigator.Select to find equivalent node from the other document it doesn't even take 1 second. But in the same loop, when i...
3
6502
by: gigs | last post by:
i have XpathNodeIterator iterator. and i have some "od" attributes when i took that nodes with that attribute i dont get anything when i call iterator.Current.GetAttribute("od", "") people please help, i cant do it anymore. this xml parser will kill me thanks!
6
7680
by: Kindler Chase | last post by:
I'm trying to iterate through a set of nodes and then edit/delete specific attributes using XPathNodeIterator. Adding attributes is no problem. My first question is how do I delete an attribute using an XPathNodeIterator? Or should I be using something else? In the sample that follows: 1. Grab all "Page" nodes. 2. Loop through all the nodes.
0
7929
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8357
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8223
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6634
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5729
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3847
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2372
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
1196
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.