Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. .NET Gurus? Generating XML doc from ASP.NET form fields

.NET Gurus? Generating XML doc from ASP.NET form fields

Scheduled Pinned Locked Moved IT & Infrastructure
xmlcsharpasp-netdatabasesysadmin
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Adam Tibi
    wrote on last edited by
    #1

    Hi, Scenario: - ASP.NET controls having their values to be stored in an XML file (with a predetermined schema) and their values will be loaded from this file as well. - Each control will map to one and only one XML element. Example: <asp:TextBox ID="_carCurrentValue" runat="server"> </asp:TextBox > will be stored in: <?xml version="1.0" encoding="UTF-8"?> <tns:competitiveQuoteRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > ... <risk xsi:type="tns:privateCarRiskType"> ... <vehicle> ... <value>1500</value> ... </vehicle> ... </risk> </tns:competitiveQuoteRequest> My Suggested solution: I have created custom controls to carry their destination path (and other metadata) like: <custom:TextBoxField ID="_carCurrentValue" runat="server" XPath="/risk/vehicle/value" /> And created a procedure that will loop through the controls and generate the XML document from scratch based on the XPath in the controls. Smarter solution anyone? I did not use any XML library to generate the XML document, is there any solution that can read from XPath (for example) and generate the node in the XML file? Suggestions?

    Make it simple, as simple as possible, but not simpler. AdamTibi.NET

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups