Hello,
Ive programmed in ASP for years but never really got my head around the whole XML thing. I understand its just text but working with it in asp seems complex to me and I never got the hang of it yet. Im hoping you can please help me figure this out...
I host at godaddy and they have the following XML components installed:
Microsoft XMLDOM 3.0 Component
Microsoft XMLDOM 4.0 Component
Microsoft ServerXMLHTTP
Microsoft XMLDOM Component
Microsoft XMLHTTP Component
The DTD im using looks like this:
<!ELEMENT Catalog ( Category* ) >
<!ELEMENT Category ( Name, Site*, Category* ) >
<!ELEMENT Commission ( #PCDATA ) >
<!ELEMENT Description ( #PCDATA ) >
<!ELEMENT EarnedPerSale ( #PCDATA ) >
<!ELEMENT TotalEarningsPerSale ( #PCDATA ) >
<!ELEMENT TotalRebillAmt ( #PCDATA ) >
<!ELEMENT HasRecurringProducts ( #PCDATA ) >
<!ELEMENT Gravity ( #PCDATA ) >
<!ELEMENT Id ( #PCDATA ) >
<!ELEMENT Name ( #PCDATA ) >
<!ELEMENT PercentPerSale ( #PCDATA ) >
<!ELEMENT PopularityRank ( #PCDATA ) >
<!ELEMENT Referred ( #PCDATA ) >
<!ELEMENT Site ( Commission? | Description+ | EarnedPerSale? | TotalEarningsPerSale? | TotalRebillAmt? | Gravity? | Id+ | PercentPerSale? | PopularityRank+ | Referred? | Title+ | HasRecurringProducts )* >
<!ELEMENT Title ( #PCDATA ) >
All I am trying to do is to open up the xml file, and read in each row of this database and put each element into its own variable and then do a do until eof type loop... being able to iterate through each row means I could then put this data easily into my SQL server as I need it to be.
Dont laugh...heres the best code I could get done so far to do this..
Dim objXMLDom,t
Set objXMLDOM = Server.CreateObject("Micro
soft.XMLDO
M")
objXMLDOM.async = False
objXMLDom.load(Server.MapP
ath("mybus
iness.xml"
))
Dim objChild
for each objChild in objXMLDOM.documentElement.
childNodes
Response.write(objChild.no
dename)
'Response.write(": ")
'response.write(objChild.t
ext & "<BR><BR>")
response.write "<BR><BR>"
response.flush
next
Set objXMLDom = Nothing
But it doesnt work so well... Can anyone on here please help me figure out how to parse my xml file properly?
Thanks!
Start Free Trial