Results 1 to 2 of 2

Thread: ASP.NET and creating xml files

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2004
    Posts
    14

    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!

  2. #2
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Fort Collins, CO
    Posts
    366

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width