Results 1 to 6 of 6

Thread: [2008] Drag drop parse xml file

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    [2008] Drag drop parse xml file

    I need to drag and drop my simple xml file onto my form.
    The xml file contains simple data like:

    <fname>Xan Choly</fname>

    On drop I need to parse the values and display them on the form.

    Can someone please show me how to :
    1. check if drag dropped file is xml
    2. parse the values


    Thanks for any help.

  2. #2
    PowerPoster keystone_paul's Avatar
    Join Date
    Nov 2008
    Location
    UK
    Posts
    3,327

    Re: [2008] Drag drop parse xml file

    A few questions :

    a) when you say the file is dropped what do you mean - are you receiving a filename or the actual content of the file?
    b) what do you mean by check if it is XML? Can you not just for an XML definition element such as "<?xml version="1.0"?>" at the top of the document, or do you mean you want to validate it against an XSD?
    c) what do you mean by "parse the values"?

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: [2008] Drag drop parse xml file

    There is no parsing required. Create an XmlDocument and call its Load method. If the load fails then there's a problem with the file. If the load succeeds then the file is valid and you can get the data using the members of the XmlDocument class, which does the parsing for you.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Re: [2008] Drag drop parse xml file

    Nice - will research this class.Thanks.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Re: [2008] Drag drop parse xml file

    Is it possible to drag drop a pdf fillable form and extract the xml ?

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    515

    Re: [2008] Drag drop parse xml file

    Last edited by Xancholy; Dec 16th, 2008 at 11:02 AM.

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