all groups > dotnet xml > october 2004 >
You're in the

dotnet xml

group:

new to xml


new to xml Amjad
10/28/2004 2:03:02 PM
dotnet xml: Hi here is the code
Dim ds As New DataSet
Dim strPath As String
Dim strMessage As String
Dim strSql As String
strSql = "SELECT NetworkID, RoadID,MeanDepth, x1,x2,y1,
y2,ColorCode" & _
" FROM RoadAnalysisMeanDepth Where NetworkID=" &
NetworkID & " Order BY MeanDepth"
Dim daExport As New OleDb.OleDbDataAdapter(strSql,
oConString.ConString)
daExport.Fill(ds, "Roads")

ds.WriteXml(Me.txtFilePathName.Text & "\MyData.xml")
But i want to add some elements to that docs
<?xml version="1.0" standalone="yes" ?>
- <NewDataSet>
<TITLE>... . . . .. .</TITLE>
<IMAGE>xxxxxxx.jpg</IMAGE>
<DESCRIPTION>. . . . . . .. . .. . . .</DESCRIPTION>
<NetworkID>1</NetworkID>
-
<Space_x0020_Syntax_x0020_Analysis_x0020_of_x0020_liverpool_x0020_city_x0020_center>
<RoadID>36</RoadID>
<MeanDepth>4.03333333333333</MeanDepth>
<x1>365</x1>
<x2>486</x2>
<y1>296</y1>
<y2>336</y2>
<ColorCode>5</ColorCode>

</Space_x0020_Syntax_x0020_Analysis_x0020_of_x0020_liverpool_x0020_city_x0020_center>
-
<Space_x0020_Syntax_x0020_Analysis_x0020_of_x0020_liverpool_x0020_city_x0020_center>
<RoadID>70</RoadID>
<MeanDepth>4.03333333333333</MeanDepth>
<x1>486</x1>
<x2>365</x2>
<y1>336</y1>
<y2>296</y2>
<ColorCode>5</ColorCode>

</Space_x0020_Syntax_x0020_Analysis_x0020_of_x0020_liverpool_x0020_city_x0020_center>
</NewDataSet>
i dont know how to add Title image and discription node to existing one
any one have idea please let me know thanks
Re: new to xml Stuart Celarier
10/31/2004 11:33:49 PM
Amjad,
[quoted text, click to view]

If you are new to XML you've got a modest bit of learning ahead of you. One
way to add elements and attributes to an existing XML document is to use the
System.Xml.XmlDocument class [1]. See the example in the CreateElement()
method docs [2] for adding an element. Don't stop there, there is a lot more
to this class.

Cheers,
Stuart Celarier, Fern Creek

[1]
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemxmlxmldocumentclasstopic.asp
[2]
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemxmlxmldocumentclasscreateelementtopic.asp

AddThis Social Bookmark Button