Solved

Support of SAX Parser with ASP

Posted on 2001-07-12
3
1,064 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 50 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

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

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

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

705 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