473,387 Members | 1,549 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,387 software developers and data experts.

Getting nodes from an XML-document

Hi

Using Xml.XmlDocument I need to get all <rfd:li>-elements below
<photoshop:SupplementalCategoriesin the below XML-sample.

I normally use GetElementsByTagName, but since there are other <rfd:id>
elements other places in the doc, I cant.

How do I navigate the tree and get the right nodes?

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="3.1.1-112">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<crs:ToneCurve>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>32, 22</rdf:li>
<rdf:li>64, 56</rdf:li>
<rdf:li>128, 128</rdf:li>
<rdf:li>192, 196</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurve>
<photoshop:SupplementalCategories>
<rdf:Bag>
<rdf:li>Category 1</rdf:li>
<rdf:li>Category 2</rdf:li>
<rdf:li>Category 3</rdf:li>
</rdf:Bag>
</photoshop:SupplementalCategories>
</rdf:Description>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>

Norm
Sep 27 '06 #1
1 1178

Klaus Jensen wrote:
Hi

Using Xml.XmlDocument I need to get all <rfd:li>-elements below
<photoshop:SupplementalCategoriesin the below XML-sample.

I normally use GetElementsByTagName, but since there are other <rfd:id>
elements other places in the doc, I cant.

How do I navigate the tree and get the right nodes?

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="3.1.1-112">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
<crs:ToneCurve>
<rdf:Seq>
<rdf:li>0, 0</rdf:li>
<rdf:li>32, 22</rdf:li>
<rdf:li>64, 56</rdf:li>
<rdf:li>128, 128</rdf:li>
<rdf:li>192, 196</rdf:li>
<rdf:li>255, 255</rdf:li>
</rdf:Seq>
</crs:ToneCurve>
<photoshop:SupplementalCategories>
<rdf:Bag>
<rdf:li>Category 1</rdf:li>
<rdf:li>Category 2</rdf:li>
<rdf:li>Category 3</rdf:li>
</rdf:Bag>
</photoshop:SupplementalCategories>
</rdf:Description>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>

Norm
You need to use the GetChilds method to load the list of child nodes
into a NodeList and then do a ForEach on the NodeList to parse through
the children.

Sep 27 '06 #2

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

Similar topics

9
by: Rolf Kemper | last post by:
Dear Experts, I got stuck with the following problem and need your help. What I wnat to do is to get a set of distinct nodes. Before the distinct I have selected the multiple occourences...
4
by: leodippolito | last post by:
Hello sirs, I am trying to send a POST request to a webservice on the click of a button. This will return me an XML document with a list of combo box items. The problem: in FIREFOX, when the...
4
by: Pavils Jurjans | last post by:
Hello, I am interested in getting the XML contents as text between two XML elements that I know follow each other. They could be in completely different levels, but in XML file the first is...
3
by: Bredahl jensen | last post by:
Hello, I'm calling a web method of an xml web service. The method returns a class that is serialized according to an xml schema definition. The xml schema is very extensive an has several level...
1
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
1
by: Christian Rühl | last post by:
hey! what i wanna do sounds very simple at first, but it turned out to be a real bone crusher... i want to check if a treeView node is checked and if a correspondent node in my xml config file...
4
by: R.Manikandan | last post by:
Hi In my code, one string variable is subjected to contain more amount of characters. If it cross certain limit, the string content in the varabile is automatically getting truncated and i am...
1
by: mharbor | last post by:
Private Sub AddNode(ByRef inXmlNode As Xml.XmlNode, _ ByRef inTreeNode As TreeNode) Dim xNode As Xml.XmlNode Dim tNode As TreeNode Dim nodeList As...
1
by: =?Utf-8?B?cGVsZWdrMQ==?= | last post by:
i have an xml for example: <xml> <data> <var>xxx</var> </data> <tip> <tips active="1">345</tips> <tips active="1">retertert</tips> <tips active="1">fdgdfg</tips> <tips...
4
by: Andrew May | last post by:
This is only my first AJAX based application so this may be a trivial question but I cannot find any way of getting at the data I want. So, I have an XML file of the form: <data>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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...

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.