If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > load table with data from xml file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-04, 04:50
faamugol faamugol is offline
Registered User
 
Join Date: Mar 2004
Posts: 58
Lightbulb load table with data from xml file

Hi,
I have data in the following xml file mydata.xml:

<DATA>
<RECORD datevalue="01.01.2003 10:00" mwh="0,001" />
<RECORD datevalue="01.01.2003 10:05" mwh="0,002" />
<RECORD datevalue="01.01.2003 10:10" mwh="0,001" />
<RECORD datevalue="01.01.2003 10:15" mwh="0,003" />
<RECORD datevalue="01.01.2003 10:20" mwh="0,001" />
</DATA>


Set SourceObj = Server.CreateObject("MSXML2.DOMDocument.4.0")
SourceObj.async = false
SourceObj.setProperty "SelectionLanguage", "XPath"
filename = Server.MapPath("mydata.xml")

SourceObj.load(filename)

set ar1 = SourceObj.documentElement.selectNodes
("//RECORD/@datevalue")
set ar2 = SourceObj.documentElement.selectNodes("//RECORD/@mwh")

I want to do the following:

To store in my two tables tab1 and tab2 with data from ar1 and ar2 without using a LOOP
I use the JOIN function
tab1 = Join(ar1, ',')
tab2 = Join(ar2, ',') but dont work

Can any one give me a idea or some links do it without ?

Thand you for your suggestion
Reply With Quote
  #2 (permalink)  
Old 03-03-04, 20:23
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
what exactly are you trying to achieve??

If you are trying to output your xml in a table format why don't you transform it using an xsl?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On