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

Writing a node like xs:element to file

Hello All.

I need to complement some information in a xml file, using the Xml.XmlDocument object.

This xml contains several <xs:element ....> nodes (is a saved dataset), and I need to write new nodes exactly in the same way the existant nodes.

I tried naming the new node as "xs:element" or type the "element" in the namespaceURI, but it when I see creates a namespace in the text file, in both cases.

How can I do that?

Cesar
Code sample I tried:

Dim nod As Xml.XmlNode = xmldocSchema.CreateNode(Xml.XmlNodeType.Element, "xs:element", "")
nodOther.AppendChild(nod)
Dim nod As Xml.XmlNode = xmldocSchema.CreateNode(Xml.XmlNodeType.Element, "xs", "element")
nodOther.AppendChild(nod)

Jun 30 '06 #1
1 1286
Cesar,

Why do you than not create your own dataset by hand and write that with writeXML

\\\
Dim ds as new DataSet("Cesar")
Dim dt As New DataTable("Persons")
ds.tables.add(dt)
dt.Columns.Add("Name")
dt.Columns.Add("USA", GetType(System.Boolean))
dt.LoadDataRow(New Object() {"Ken Tucker", True}, True)
dt.LoadDataRow(New Object() {"Cor Ligthert", False}, True)
ds.writeXML("Path")
///

I hope this helps,

Cor
"ronchese" <info(a)carsoftnet.com.br> schreef in bericht news:eS******************@TK2MSFTNGP02.phx.gbl...
Hello All.

I need to complement some information in a xml file, using the Xml.XmlDocument object.

This xml contains several <xs:element ....> nodes (is a saved dataset), and I need to write new nodes exactly in the same way the existant nodes.

I tried naming the new node as "xs:element" or type the "element" in the namespaceURI, but it when I see creates a namespace in the text file, in both cases.

How can I do that?

Cesar
Code sample I tried:

Dim nod As Xml.XmlNode = xmldocSchema.CreateNode(Xml.XmlNodeType.Element, "xs:element", "")
nodOther.AppendChild(nod)
Dim nod As Xml.XmlNode = xmldocSchema.CreateNode(Xml.XmlNodeType.Element, "xs", "element")
nodOther.AppendChild(nod)

Jun 30 '06 #2

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

Similar topics

2
by: Adam Retter | last post by:
I would like to have an element defined in my XML Schema, that can hold either an xs:string or xs:int value. Is this possible? e.g. something like - <xs:element name="service">...
3
by: Robert Oschler | last post by:
What's a good way to find a specific text node element in a web page's DOM tree? I thought of traversing each node but there has to be a faster way. Is there a "find text node by nodeValue"...
6
by: Boobie | last post by:
Is there any other way to remove a node/element other than going into the Parent and do "removeChild" ? thanks (need to remove a div of id "foobar")
1
by: trialproduct2004 | last post by:
Hi all, I am having table in database with say name as '1company'. when i generate strongly typed dataset for this table in xsd file i am getting entry as below:- <xs:element...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.