none
HTML Form to XML Document

    Question

  • I am lost, I have been trying to figure out how to add a regular old html form to generate data onto a page saved into an xml document then transformed it through  a xslt to generate a news page.  I read an article on how "easy it was" to do however I know nothing about an XML DOM creation which seems to be like a brick wall to my progress.

    In the process I've managed to @#$ up my Default.aspx so it is not recognizing or locating something connected with it.... Sad

    so my questions are:

    1. is it possible to create an XMLDom with generates XML Documents with data entered from an HTML form
    2. if so is there a walkthrough which can help me create an XMLDom
    3. do I have to reconstruct my Default page in order to debug it?

    Your help is most appreciated
    Lost in VB
    Thanks

    Saturday, April 30, 2005 8:03 PM

Answers

  • Not entire clear what you are trying to do, but the HTML Form Data will be posted to your ASPX page, from there you can do something like this:

     ' create empty XML Document object
    Dim doc as XmlDocument = new XmlDocument()
    doc.LoadXml("<data/>")

    ' Load the fields from the FORM into the child XML elements
    Dim field1 as string = Request.Form("field1")
    Dim child = doc.CreateElement("field1")
    child.InnerText = field1
    doc.DocumentElement.AppendChild(child)

    ' Then save the XML document on your server
    doc.Save(Server.MapPath("data.xml"))
    Tuesday, May 03, 2005 5:34 PM

All replies

  • Not entire clear what you are trying to do, but the HTML Form Data will be posted to your ASPX page, from there you can do something like this:

     ' create empty XML Document object
    Dim doc as XmlDocument = new XmlDocument()
    doc.LoadXml("<data/>")

    ' Load the fields from the FORM into the child XML elements
    Dim field1 as string = Request.Form("field1")
    Dim child = doc.CreateElement("field1")
    child.InnerText = field1
    doc.DocumentElement.AppendChild(child)

    ' Then save the XML document on your server
    doc.Save(Server.MapPath("data.xml"))
    Tuesday, May 03, 2005 5:34 PM
  • Thank you, I ended up rendering things using the dataset to datalist instead and now I understand that Microsoft is delaying the release of something pertaining to the written xml document... so using the object database instead of the xml database hookup seems to have been a wise decision.  I will keep your notes however, because at sometime in the near future I'm sure that it will prove useful.

    Thanks
    Wednesday, May 18, 2005 12:29 PM