|
-
Jun 30th, 2004, 11:12 AM
#1
Thread Starter
New Member
ASP.NET and creating xml files
I have an app that needs to create xml files by extracting data from a database. I can do this fine.
I am using in my code...
Dim writer As New XmlTextWriter(Server.MapPath("test.xml"), Encoding.UTF8)
XmlTextWriter
writer.WriteStartDocument()
writer.WriteStartElement("TEST")
writer.WriteElementString("Items", "Item1")
and so on (for example)
The problem is when I need to create tags (elements) with Attributes
If I need to have an element ie.. <Country Language=English>Canada</Country>
Using the writer.WriteStartElement method gives me errors due to the spacing.
So how do I in asp.net create these tags/elements with spaces and add attributes. Do I use WriteStartElement or sommething else. Any help would be appreciated and an example of code if you can provide any!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|