Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 29th, 2003, 03:07 PM
Authorized User
 
Join Date: Sep 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Teon
Default Create a XML ?

How to create a XML like the following structure if the XML does not exist?

<?xml version="1.0" standalone="yes"?>
<MsgList>
  <Msg>
    <Sender>02SAS10775</Sender>
    <Date></Date>
    <Title></Title>
    <Content></Content>
    <Status></Status>
  </Msg>
</MsgList>

Thank you. :)

 
Old September 30th, 2003, 12:53 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

How about this:

Dim objMsgList, objMsg, objNode As System.Xml.XmlNode

objMsgList = objXML.CreateNode(System.Xml.XmlNodeType.Element, "MsgList", String.Empty)
objXML.AppendChild(objMsgList)
objMsg = objXML.CreateNode(System.Xml.XmlNodeType.Element, "Msg", String.Empty)
objMsgList.AppendChild(objMsg)
objNode = objXML.CreateNode(System.Xml.XmlNodeType.Element, "Sender", String.Empty)
objNode.InnerText = "02SAS10775"
objMsg.AppendChild(objNode)
objNode = objXML.CreateNode(System.Xml.XmlNodeType.Element, "Date", String.Empty)
objMsg.AppendChild(objNode)
objNode = objXML.CreateNode(System.Xml.XmlNodeType.Element, "Title", String.Empty)
objMsg.AppendChild(objNode)
objNode = objXML.CreateNode(System.Xml.XmlNodeType.Element, "Content", String.Empty)
objMsg.AppendChild(objNode)
objNode = objXML.CreateNode(System.Xml.XmlNodeType.Element, "Status", String.Empty)
objMsg.AppendChild(objNode)

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create xml tag version? ksreddy007in XSLT 2 August 1st, 2008 06:07 PM
create XML from database table angshujit ASP.NET 2.0 Basics 0 February 1st, 2007 07:09 AM
Create a new XML file with vbscript sswingle XML 4 April 24th, 2006 07:31 AM
Problem to create an xml file from two xml files saurabh_inblore XSLT 1 April 12th, 2006 02:58 AM
create xml file using c# kk_katepally General .NET 2 February 11th, 2005 02:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.