How do I create an XML file for my VB 2005 App?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dm1608

    How do I create an XML file for my VB 2005 App?

    I would like to plug in a bunch of static, but related, information into a
    XML file that can be used by my VB.NET 2005 utility application.

    I would like to do something like:

    <shortname>
    <longname>
    <description>
    <version>
    <dateupdated>
    </shortname>
    <shortname>
    <longname>
    <description>
    <version>
    <dateupdated>
    </shortname>
    <shortname>
    <longname>
    <description>
    <version>
    <dateupdated>
    </shortname>
    <shortname>
    <longname>
    <description>
    <version>
    <dateupdated>
    </shortname>
    ....
    ....

    How do I initially create this sort of XML file for my app? Can I use
    VS.NET 2005 IDE or must I do it by hand or use a third party XML editor
    tool?

    How do I read it?

    I see a lot about how to work with consuming an XML file, but never see
    anything about creating on for your own application and consuming it.

    Any help or direction would be appreciated.




  • Scherbina Vladimir

    #2
    Re: How do I create an XML file for my VB 2005 App?

    Take a look at XmlTextWriter class.

    --
    Vladimir


    "dm1608" <dm1608@spam.ne t> wrote in message
    news:%23YBZ5Np$ FHA.140@TK2MSFT NGP12.phx.gbl.. .[color=blue]
    >I would like to plug in a bunch of static, but related, information into a
    >XML file that can be used by my VB.NET 2005 utility application.
    >
    > I would like to do something like:
    >
    > <shortname>
    > <longname>
    > <description>
    > <version>
    > <dateupdated>
    > </shortname>
    > <shortname>
    > <longname>
    > <description>
    > <version>
    > <dateupdated>
    > </shortname>
    > <shortname>
    > <longname>
    > <description>
    > <version>
    > <dateupdated>
    > </shortname>
    > <shortname>
    > <longname>
    > <description>
    > <version>
    > <dateupdated>
    > </shortname>
    > ...
    > ...
    >
    > How do I initially create this sort of XML file for my app? Can I use
    > VS.NET 2005 IDE or must I do it by hand or use a third party XML editor
    > tool?
    >
    > How do I read it?
    >
    > I see a lot about how to work with consuming an XML file, but never see
    > anything about creating on for your own application and consuming it.
    >
    > Any help or direction would be appreciated.
    >
    >
    >
    >[/color]


    Comment

    • Peter Flynn

      #3
      Re: How do I create an XML file for my VB 2005 App?

      dm1608 wrote:
      [color=blue]
      > I would like to plug in a bunch of static, but related, information
      > into a XML file that can be used by my VB.NET 2005 utility
      > application.[/color]
      [snip][color=blue]
      > How do I initially create this sort of XML file for my app? Can I use
      > VS.NET 2005 IDE or must I do it by hand or use a third party XML
      > editor tool?[/color]

      XML is just plain text, so for a single-occurrence file, just create
      it using any plain-text editor. If you want to ensure it is created
      accurately and consistently, however, use a proper XML editor. If it
      really is a 1-off task, using an IDE is probably overkill unless there
      is some programmaticall y-accessible data that needs including that you
      can't get at by hand-editing.
      [color=blue]
      > How do I read it?[/color]

      Open it in a plain-text editor if you mean "how do I, as a human, read
      it". Otherwise it depends what you want to do with it afterwards: it's
      a file, so you open it in some kind of application.
      [color=blue]
      > I see a lot about how to work with consuming an XML file, but never
      > see anything about creating on for your own application and consuming
      > it.[/color]

      This is worrying. A plain-text file is not hard to create. As someone
      who writes a lot of documentation, I would value your input (off-group)
      as to what we tech authors are not explaining that need explaining.
      We've clearly missed something important here. And I'd appreciate more
      input from others in the same position (but not here: use email).

      ///Peter
      --
      XML FAQ: http://xml.silmaril.ie/

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: How do I create an XML file for my VB 2005 App?

        DM

        Just use a XML dataset, there are plenty of samples how to do that on our
        website.



        I hope this helps,

        Cor


        Comment

        • Peter Bromberg [C# MVP]

          #5
          RE: How do I create an XML file for my VB 2005 App?

          You can choose Add/ New Item from the Project context menu, and choose "Xml
          File". This will create a new blank Xml File in the IDE that you can edit.
          Peter

          --
          Co-founder, Eggheadcafe.com developer portal:

          UnBlog:





          "dm1608" wrote:
          [color=blue]
          > I would like to plug in a bunch of static, but related, information into a
          > XML file that can be used by my VB.NET 2005 utility application.
          >
          > I would like to do something like:
          >
          > <shortname>
          > <longname>
          > <description>
          > <version>
          > <dateupdated>
          > </shortname>
          > <shortname>
          > <longname>
          > <description>
          > <version>
          > <dateupdated>
          > </shortname>
          > <shortname>
          > <longname>
          > <description>
          > <version>
          > <dateupdated>
          > </shortname>
          > <shortname>
          > <longname>
          > <description>
          > <version>
          > <dateupdated>
          > </shortname>
          > ....
          > ....
          >
          > How do I initially create this sort of XML file for my app? Can I use
          > VS.NET 2005 IDE or must I do it by hand or use a third party XML editor
          > tool?
          >
          > How do I read it?
          >
          > I see a lot about how to work with consuming an XML file, but never see
          > anything about creating on for your own application and consuming it.
          >
          > Any help or direction would be appreciated.
          >
          >
          >
          >
          >[/color]

          Comment

          • Paul Wu

            #6
            Re: How do I create an XML file for my VB 2005 App?

            Once you have the xml file created and is stored in a known location, it is
            extremely easy to read an XML file using the XmlDocument class.

            Try this:

            Dim XmlDoc As New System.Xml.XmlD ocument

            XmlDoc.Load("fi lename.xml")



            Paul Wu





            "dm1608" <dm1608@spam.ne t> wrote in message
            news:%23YBZ5Np$ FHA.140@TK2MSFT NGP12.phx.gbl.. .[color=blue]
            >I would like to plug in a bunch of static, but related, information into a
            >XML file that can be used by my VB.NET 2005 utility application.
            >
            > I would like to do something like:
            >
            > <shortname>
            > <longname>
            > <description>
            > <version>
            > <dateupdated>
            > </shortname>
            > <shortname>
            > <longname>
            > <description>
            > <version>
            > <dateupdated>
            > </shortname>
            > <shortname>
            > <longname>
            > <description>
            > <version>
            > <dateupdated>
            > </shortname>
            > <shortname>
            > <longname>
            > <description>
            > <version>
            > <dateupdated>
            > </shortname>
            > ...
            > ...
            >
            > How do I initially create this sort of XML file for my app? Can I use
            > VS.NET 2005 IDE or must I do it by hand or use a third party XML editor
            > tool?
            >
            > How do I read it?
            >
            > I see a lot about how to work with consuming an XML file, but never see
            > anything about creating on for your own application and consuming it.
            >
            > Any help or direction would be appreciated.
            >
            >
            >
            >[/color]


            Comment

            Working...