Line | |
---|
1 | Namespace XmlTest
|
---|
2 |
|
---|
3 |
|
---|
4 | Sub TestMain()
|
---|
5 | Dim doc = New System.Xml.XmlDocument()
|
---|
6 | doc.AppendChild( doc.CreateXmlDeclaration( "1.0", "UTF-8", Nothing ) )
|
---|
7 | doc.AppendChild( doc.CreateElement( "root" ) )
|
---|
8 | doc.ChildNodes[1].AppendChild( doc.CreateElement( "test" ) )
|
---|
9 |
|
---|
10 | Dim attr1 = doc.CreateAttribute( "attr1" )
|
---|
11 | attr1.Value = "123"
|
---|
12 | doc.ChildNodes[1].Attributes.Add( attr1 )
|
---|
13 | Dim attr2 = doc.CreateAttribute( "attr2" )
|
---|
14 | attr2.Value = "456"
|
---|
15 | doc.ChildNodes[1].Attributes.Add( attr2 )
|
---|
16 |
|
---|
17 | System.Diagnostics.Debug.WriteLine( doc.OuterXml() )
|
---|
18 | End Sub
|
---|
19 |
|
---|
20 |
|
---|
21 | End Namespace
|
---|
22 |
|
---|
23 | XmlTest.TestMain()
|
---|
Note:
See
TracBrowser
for help on using the repository browser.