participate


Sun Java System Active Server Pages - Sun ASP and XML
This question is not answered.

<<   Back to Forum  |   Give us Feedback Topics: « Previous | Next »
This topic has 8 replies on 1 page.
Adam_M.
Posts:5
Registered: 6/16/08
Sun ASP and XML   
Jun 16, 2008 10:19 AM
 
 
Hi,

I've been given the task of developing a new website for a charitable organisation. It is to be implemented on a Sun ASP based box where-as the development box is Microsoft ASP.

So far so good!

I'm now trying to process an XML file and failing miserably. My XML is thus:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<a>
<b c="C1">
<d e="E1" f="F1" />
</b>

<b c="C2">
<d e="E2" f="F2" />
</b>

<b c="C3">
<d e="E3" f="F3" />
</b>
</a>

And my ASP file is thus:

<%
With Response
.Buffer = True

.AddHeader "Pragma", "no-cache"

.CacheControl = "no-cache"

.Expires = -1

If Instr(Request.ServerVariables("HTTP_ACCEPT"), "application/xhtml+xml") > 0 Then
.ContentType = "application/xhtml+xml"
Else
.ContentType = "text/html"
End If

.Charset = "UTF-8"
End With

Dim objXML, objGroup, objItem

data = Replace(Split(Request.ServerVariables("SCRIPT_NAME"), "/")(UBound(Split(Request.ServerVariables("SCRIPT_NAME"), "/"))), ".asp", ".xml")

Set objXML = Server.CreateObject("MSXML2.DOMDocument")

Response.Write Server.MapPath(data) & "<br />"

With objXML
.load Server.MapPath(data)

Set objGroup = .getElementsByTagName("b")

Response.Write IsObject(objGroup) & "<br />"
Response.Write objGroup & "<br />"
Response.Write objGroup.length & "<br />"

'For Each objItem In objGroup.getElementsByTagName("b")
' Response.Write objItem & "<br />"
'Next

Set objGroup = Nothing
End With

Set objXML = Nothing
%>

No matter what I try I can't seem to get objGroup.length to return anything other than 0 and thus can't process any of the elements.

Can anyone please advise?

Cheers,



Adam M.
 
Duncan_Berriman
Posts:328
Registered: 3/23/05
Re: Sun ASP and XML   
Jun 17, 2008 1:17 AM (reply 1 of 8)  (In reply to original post )
 
 
What version of asp are you running?
 
Adam_M.
Posts:5
Registered: 6/16/08
Re: Sun ASP and XML   
Jun 17, 2008 6:52 AM (reply 2 of 8)  (In reply to #1 )
 
 
Not sure - how can I find out using ASP (not my server).

Cheers
 
Duncan_Berriman
Posts:328
Registered: 3/23/05
Re: Sun ASP and XML   
Jun 17, 2008 7:22 AM (reply 3 of 8)  (In reply to #2 )
 
 
I'm not aware of any way other than from the command line or the admin control panel.

If you are using anything other than 4.0.2 (preferably 4.0.3) you are probably wasting your time.

I'd ask your supplier what the version is. Bear in mind even 4.0.2 is a number of years old.

Duncan
 
Adam_M.
Posts:5
Registered: 6/16/08
Re: Sun ASP and XML   
Jun 18, 2008 3:54 AM (reply 4 of 8)  (In reply to #3 )
 
 
Hi,

Thanks for the responses so far.

I can now confirm the version is 4.0.2.

King regards.
 
  sriram.natarajan
Posts:365
Registered: 11/13/07
Re: Sun ASP and XML   
Jun 29, 2008 7:17 PM (reply 5 of 8)  (In reply to #4 )
 
 
you might want to upgrade to 4.0.3 because of potential security vulnerabilities in 4.0.2
 
pdwOnline
Posts:1
Registered: 11/7/08
Re: Sun ASP and XML   
Nov 7, 2008 6:55 AM (reply 6 of 8)  (In reply to original post )
 
 
Con you create an object like msxml?? I doubt if that is available on a non microsft server (that is likely to be the hosted server)...
 
Duncan_Berriman
Posts:328
Registered: 3/23/05
Re: Sun ASP and XML   
Nov 11, 2008 8:02 AM (reply 7 of 8)  (In reply to #6 )
 
 
Yes you can check out the docs. You may need to do some port specific coding but that should be fairly easy to do.

That said Sun One ASP is way out of date and appears to have been shelved so I wouldn't bother using it for any new development.

Duncan
 
Deeveloper
Posts:4
Registered: 8/6/07
Re: Sun ASP and XML   
May 24, 2009 7:36 AM (reply 8 of 8)  (In reply to original post )
 
 
i know thisthread is old but:

i think the problem is your code not ASP...

try

Set objGroup = objXML.getElementsByTagName("b")

I don't thnk you can mix the "with" statement with the "se"t statement
 
This topic has 8 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 55
  • Guests : 140

About Sun forums
  • Sun Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Sun Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums