|
-
Sep 9th, 2002, 09:39 AM
#1
Thread Starter
Junior Member
xml and ado
It is possible to load a node of a xmlDocument in an adodb recordset?
-
Sep 10th, 2002, 02:10 AM
#2
Fanatic Member
yes it is possible. create a disconnected recordset and use the open method, specifying the path to the xml file. The fragment must be in a valid ado xml schema. To find out what the valid schema is, connect to a database and select something. Then execute the save method of the recordset object and specify persistxml with the filepath. This should generate an xml file. Open the file and have a look at the schema. That is the format you have to use with the recordset object.
Play around with editing records and then saving the xml file. This will show how they handle persistent data and updates.
Unfortunately, I do not have time to type out an example at the moment.
-
Sep 10th, 2002, 02:58 AM
#3
Thread Starter
Junior Member
xml and ado recordsets
Thanks for your response. It is possible I don't understand you exactly. If I use the open method:
recordset.Open path\file.xml, adoConnection
I load in the recordset all the xml file. Imagine I have a xml file like this:
<?xml version="1.0"?>
<extract>
<title1>
…
</title1>
<title2>
…
</title2>
<lines>
<line>
…
</line>
<line>
…
</line>
<line>
…
</line>
</lines>
</extract>
..and I want to load into a recordset only the ‘lines’ node. How can I do it?
-
Sep 10th, 2002, 11:40 AM
#4
Fanatic Member
I have not tried this, but I presume that you would have to wrap the node in the ado schema. I don't think the format you have above would work either, but it's worth a try.
Use xslt to get the data into the correct format.
-
Sep 12th, 2002, 05:11 AM
#5
Thread Starter
Junior Member
xml and ado recordsets
I have solved the problem, perhaps not in better way.
I put in a xmlNode variable the node I want treat. Then with a new xmlDocument variable I add the node and save the xmlDocument i a new xml file. Finally I open a recordset when the source parameter is the new xml file (that only contents the node I want).
thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|