?
Solved

Support of SAX Parser with ASP

Posted on 2001-07-12
3
Medium Priority
?
1,066 Views
Last Modified: 2012-08-13
Hi all
 Can we use a SAX parser in ASP Coding.. How to use it and also provide the code to do socode.

if we instantiate XMLDom at client side does Netscape brwose support . since Msxml dll file comes along with IE will netscape support i.e a system having only Netscape browser support the xmldom instantiation at client side does the msxml dll be present along with  netscape ?

0
Comment
Question by:indu_ma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
edmund_mitchell earned 200 total points
ID: 6280600
Of course you can use a SAX parser in ASP coding.  One needs only to instantiate the parser, load the file, instantiate the content handler and code the content handler implementation. So certainly you can do a transform using a SAX parser.

ASP
<%Response.ContentType = "text/xml"
     
    Dim generator, ch
    ' instantiate XML generator class
    Set generator = Server.CreateObject("XMLFilesVBSAX.CGenerator")
    Set ch = Server.CreateObject("XMLFilesVBSAX.CSerializer")
    ch.RegisterOutputStream Response
    generator.generateXML ch
%>

Then ->

<%Response.ContentType = "text/xml"
     
    Dim reader, ch
    ' instantiate XMLReader class
    Set reader = Server.CreateObject("MSXML2.VBSAXXMLReader.3.0")
    ' instantiate class that implements IVBSAXContentHandler
    Set ch = Server.CreateObject("XMLFilesVBSAX.CSerializer")
    ch.RegisterOutputStream Response
    ' turn off namespace prefixes
    reader.putFeature "http://xml.org/sax/features/namespace-prefixes", False
    ' register ContentHandler implementation
    Set reader.contentHandler = ch
    ' begin processing document
    reader.parseURL "file://c:\temp\whatever.xml"
%>

And lastly ->

<%    
    Dim reader, ch
    ' instantiate XMLReader class
    Set reader = Server.CreateObject("MSXML2.VBSAXXMLReader.3.0")
    ' instantiate class that implements IVBSAXContentHandler
    Set ch = Server.CreateObject("XMLFilesVBSAX.CInvoice2HTML")
    ' turn off namespace prefixes
    reader.putFeature "http://xml.org/sax/features/namespace-prefixes", False
    ' register ContentHandler implementation
    Set reader.contentHandler = ch
    ' begin processing document    
    reader.parseURL "file://c:\temp\whatever.xml"
%>

These code snippets will serialize XML into HTML or vice versa (uses a whatever.xml file - not included).  There's much more you can do, but this is a simple start.

Also, you might get some mileage from this M$ website:

http://msdn.microsoft.com/library/default.asp?URL=/library/en-us/dnxml/html/vbsax2jumpstart.asp

Netscape can work with the DOM up to Level 1 in 6.0.  Check out:
http://www.scottandrew.com/index.php/articles/dom_1
for some info.

I hope that answers your questions.

Edmund
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6790047
It's time to clean up this topic area and that means taking care of this question. Your options at this point are:

1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.

2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

3.  Ask Community Support to help split points between participating experts.  Just comment here with details.

4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.

If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.

PLEASE DO NOT AWARD THE POINTS TO ME.
____________________________________________
---------->  Hi Experts:

In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.

------------->  The ALL TOPICS link has been updated today to reflect all the new TAs.

Thank you everyone.

Moondancer :)
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6867197
Finalized by EE Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question