Click here to Skip to main content
15,897,291 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: Displaying Carriage Return || Line Feed Pin
Anonymous15-Nov-02 1:41
Anonymous15-Nov-02 1:41 
GeneralRe: Displaying Carriage Return || Line Feed Pin
Lilian Chan-Grant19-Nov-02 8:48
Lilian Chan-Grant19-Nov-02 8:48 
QuestionMSXML version included in what version of IE? Pin
Andrew Connell12-Nov-02 2:48
Andrew Connell12-Nov-02 2:48 
AnswerRe: MSXML version included in what version of IE? Pin
Daniel Turini12-Nov-02 2:53
Daniel Turini12-Nov-02 2:53 
GeneralRe: MSXML version included in what version of IE? Pin
Andrew Connell12-Nov-02 2:56
Andrew Connell12-Nov-02 2:56 
GeneralRe: MSXML version included in what version of IE? Pin
Paul Watson12-Nov-02 3:04
sitebuilderPaul Watson12-Nov-02 3:04 
GeneralRe: MSXML version included in what version of IE? Pin
Andrew Connell12-Nov-02 3:56
Andrew Connell12-Nov-02 3:56 
Generalretrieving data fro database Pin
Gazzer7-Nov-02 23:44
Gazzer7-Nov-02 23:44 
Could someone please look at the following code and tell me why I get the error below.

Sorry for the length of code.

=====ERROR on Page ======

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'child.Text'

/council_services/data/wastedata.asp, line 60


The error occurs no matter which field I choose from the database recordset.

Now the same code works fine with another database I used for testing, but not this one.

Please help.
=====END ERROR =====

Within the following code.

=====CODE=====
<%

'------------------------ DATABASE CONNECTION -----------------------------------------

'The database connection is done through the include file above.

'------------------------ XML DOM OBJECT CREATION ------------------------------------

'Create XMLDOM Object
Dim xmldoc
Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")

'------------------------ BULK OF XML CODE ------------------------------------------------

If (xmldoc.childNodes.length = 0) Then
' Build the XML document, and asign the root node.
Set root = xmldoc.createNode("element", "council_services", "")

xmldoc.appendChild (root)

' Queries the database for customer data, this will be referenced later.
' Use recordset(0) where 0 is the order of the datafield of the recordset.

Sql = "SELECT StreetName, Area, Round, Day FROM WasteCollection"

Set rs = conn.Execute(Sql)

If Rs.eof or rs.bof then

'If there are no results from the search criteria, then put the following text
'onto the page
Response.Write "


" & "There are currently no information available, please try again." & "

"
Else
rs.MoveFirst

'Loop through the recordset
Do While Not rs.EOF

Set onode = xmldoc.createNode("element", "Waste", "")
xmldoc.documentElement.appendChild (onode)

'The following code, sets the child elements of the recordset
'to the xml data page.

'Set child = xmldoc.createNode("element", "CollectionStreet", "")
'child.Text = rs.fields(0)
'onode.appendChild (child)

'Set child = xmldoc.createNode("element", "CollectionArea", "")
'child.Text = rs.fields(1)
'onode.appendChild (child)

'Set child = xmldoc.createNode("element", "CollectionRound", "")
'child.Text = rs.fields(2)
'onode.appendChild (child)

Set child = xmldoc.createNode("element", "CollectionDay", "")
child.Text = rs.fields(2)
onode.appendChild (child)

rs.movenext
Loop

Set rs = Nothing

'Save the XML doc, this will be saved to the folder which contains the asp pages.
xmldoc.save server.mappath("wastedata.xml")

'--------------------------- DISPLAY THE XML DATA ---------------------------------------------

' Linking XML and XSL together
sourceFile = Server.MapPath("wastedata.xml")
styleFile = Server.MapPath("wastedata.xsl")

'Create the microsoft DOM object for both source and style (xsl) pages.

set source = Server.CreateObject("Microsoft.XMLDOM")
source.async = false
source.load(sourceFile)

set style = Server.CreateObject("Microsoft.XMLDOM")
style.async = false
style.load(styleFile)

Response.Write source.transformNode(style)
End If
End If


=====END CODE=====

The four fields form the database are all Varchar.

I would much appreciate some response to the about please.

Gazzer.
GeneralHELP!! WriteXml and DataSets Pin
Karen7-Nov-02 18:45
Karen7-Nov-02 18:45 
GeneralRe: HELP!! WriteXml and DataSets Pin
Christian Graus7-Nov-02 19:06
protectorChristian Graus7-Nov-02 19:06 
GeneralRe: HELP!! WriteXml and DataSets Pin
8-Nov-02 6:27
suss8-Nov-02 6:27 
GeneralRe: HELP!! WriteXml and DataSets Pin
Ranjan Banerji19-Nov-02 9:23
Ranjan Banerji19-Nov-02 9:23 
GeneralSerializing an Exception object to XML Pin
solidstore7-Nov-02 7:13
solidstore7-Nov-02 7:13 
Generalbeginner question: xml parsing Pin
sagmam7-Nov-02 3:22
sagmam7-Nov-02 3:22 
GeneralRe: beginner question: xml parsing Pin
Ravi Bhavnani7-Nov-02 7:54
professionalRavi Bhavnani7-Nov-02 7:54 
GeneralRe: beginner question: xml parsing Pin
Christian Graus7-Nov-02 10:09
protectorChristian Graus7-Nov-02 10:09 
GeneralRe: beginner question: xml parsing Pin
Michael A. Barnhart7-Nov-02 15:42
Michael A. Barnhart7-Nov-02 15:42 
GeneralRe: beginner question: xml parsing Pin
Anonymous21-Nov-02 2:34
Anonymous21-Nov-02 2:34 
QuestionHow to ... Pin
Tomas Petricek6-Nov-02 7:19
Tomas Petricek6-Nov-02 7:19 
AnswerRe: How to ... Pin
Michael A. Barnhart6-Nov-02 13:35
Michael A. Barnhart6-Nov-02 13:35 
AnswerRe: How to ... Pin
Philip Fitzsimons7-Nov-02 1:34
Philip Fitzsimons7-Nov-02 1:34 
QuestionWho knows PHP ? Pin
Member 15922365-Nov-02 6:57
Member 15922365-Nov-02 6:57 
AnswerRe: Who knows PHP ? Pin
Philip Fitzsimons5-Nov-02 23:31
Philip Fitzsimons5-Nov-02 23:31 
GeneralRe: Who knows PHP ? Pin
Christian Graus6-Nov-02 19:12
protectorChristian Graus6-Nov-02 19:12 
GeneralRe: Who knows PHP ? Pin
Paul Watson7-Nov-02 2:20
sitebuilderPaul Watson7-Nov-02 2:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.