Reading XML Files from Sharepoint Location

D

Dan the Man

Hi There,

Background:
We're trying to create a multi-infopath form application. That way
duplication of infomation can be minimized. To implement this solution, we
decided to use drop downs to link to Sharepoint Form Lists.

For Example:
I have a drop down called Fruits. Our sharepoint Form list would have
apple.xml,banana.xml,grapes.xml,.... etc. The drop down would display these
file names.

Now, each <fruit>.xml file contains detailed information about that piece of
fruit which I'd like my main form (with the fruit drop down) to get using C#.


The Question:
What is the best way to obtain this information?

Some ideas:
1) Use C#'s xml utilities to open the file up and read the contents one node
at a time.
2) Create a Datasource schema that mimics the details of the fruit? And try
to load the schema??

I'm looking for other ideas before implementing a solution.

Thank you in advance for your help.

Dan
 
P

Patrick Halstead

Hi Dan,
We've done this for a project before to prepopulate part of the form. We
used SharePoint lists and option #1 below.
Cheers,
Patrick
InfoPath MVP
 
D

Dan The Man

Hi Patrick,

Thank you for the option.. Can you help me understand how you get at the xml
file and parse it a bit? For example, how did you refer to the file? Using
an URI? or did you have to copy the file locally before using it? Once you
opened it, what did you have to do to enable the parser to read it?

Thanks for your help.

Dan
 
D

Dan The Man

Matthew,

Is there any chance you can show me a small snippet of the C# code that
would set the dataobject's file path to point to the URL at runtime?

Thanks in advance,

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top