Questions tagged [xmlnode]

XML document unit (element, entity, attribute, text, comment, notation, even document or it's fragment).

XML document unit (element, entity, attribute, text, comment, notation, even document or it's fragment). XML node types

486 questions
403
votes
13 answers

What's the difference between an element and a node in XML?

I'm working in Java with XML and I'm wondering; what's the difference between an element and a node?
Philip Morton
  • 129,733
  • 38
  • 88
  • 97
48
votes
1 answer

How to modify existing XML file with XmlDocument and XmlNode in C#

I already implemented to create the XML file below with XmlTextWriter when application initialization. And know I don't know how to update the childNode id value with XmlDocument & XmlNode. Is there some property to update the id value? I tried…
Nano HE
  • 9,109
  • 31
  • 97
  • 137
28
votes
5 answers

Converting XElement into XmlNode

I know there is no direct method of doing it but still.. Can we convert XElement element into XmlNode. Options like InnerText and InnerXml are XmlNode specific. so,if i want to use these options, what can be done to convert XElement into…
Sangram Nandkhile
  • 17,634
  • 19
  • 82
  • 116
27
votes
2 answers

In C#, how do I convert a XmlNode to string, with indentation? (Without looping)

This has got to be such a simple question but I just can't get the answer. I have an XmlNode and all I want to do is output this node, as a string, with indentations (tabs or spaces) intact to provide better readability. So far I tried XmlWriter,…
Yuf
  • 610
  • 2
  • 6
  • 14
22
votes
4 answers

Modify XML existing content in C#

Purpose: I plan to Create a XML file with XmlTextWriter and Modify/Update some Existing Content with XmlNode SelectSingleNode(), node.ChildNode[?].InnerText = someting, etc. After I created the XML file with XmlTextWriter as below. XmlTextWriter…
Nano HE
  • 9,109
  • 31
  • 97
  • 137
21
votes
7 answers

How to get the attribute value of an xml node using java

I have an xml which looks like this: { .....} Here I want to retrieve the value of "source type" where type is an attribute. I tried the following, which didn't…
Priya
  • 469
  • 3
  • 6
  • 14
20
votes
5 answers

Convert org.w3c.dom.Node into Document

I have a Node from one Document. I want to take that Node and turn it into the root node of a new Document. Only way I can think of is the following: Node node = someChildNodeFromDifferentDocument; DocumentBuilderFactory factory =…
Svish
  • 152,914
  • 173
  • 462
  • 620
18
votes
5 answers

Changing node name of xml-node with Java

I have following scenario: I have a XML-Document, e.g. like this
doro
  • 785
  • 3
  • 11
  • 23
17
votes
3 answers

xmlNode to objects

I have been working with a 3rd party java based REST webservice, that returns an array of xmlNodes. The xmlNode[] respresent an object and I am trying to work out the best way to Deserialize the xmlNode[] in the object? is it to build up a…
76mel
  • 3,993
  • 2
  • 22
  • 21
13
votes
1 answer

How to load an XmlNode object ignoring undeclared namespaces?

I want to load up an XmlNode without getting an XmlException when an unrecognized namespace is present. The reason is because I need to pass an XMLNode instance to a method. I'm loading up arbitrary XML fragments having namespaces out of their…
John K
  • 28,441
  • 31
  • 139
  • 229
12
votes
6 answers

How to change XML node values

I have an XML (this is exactly what it looks like):
JJ.
  • 9,580
  • 37
  • 116
  • 189
11
votes
1 answer

Get the total number of nodes and counting nodes

Is it possible to get the total number of XML nodes? Also, how does one do a for-statement with XSLT?
dougoftheabaci
9
votes
2 answers

insert XmlDocument into a XmlDocument node

I created a basic XmlDocument with one node: XmlDocument bigDoc = new XmlDocument(); bigDoc.LoadXml(""); and I'm getting another XmlDocument that I want to insert inside node. It doesn't work for me: XmlNode…
Rodniko
  • 4,926
  • 20
  • 69
  • 93
8
votes
3 answers

Loop through multiple subnodes in XML

VI VII abc def I have to loop through Classes to get 'Class' into…
user752709
  • 85
  • 1
  • 1
  • 4
8
votes
5 answers

Match conditionally upon current node value

Given the following XML: jd John Doe jd Pierre Spring
Pierre Spring
  • 10,525
  • 13
  • 49
  • 44
1
2 3
32 33