[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 :
- check if drag dropped file is xml
- parse the values
Thanks for any help.
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"?
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.
Re: [2008] Drag drop parse xml file
Nice - will research this class.Thanks.
Re: [2008] Drag drop parse xml file
Is it possible to drag drop a pdf fillable form and extract the xml ?
Re: [2008] Drag drop parse xml file