Solved

Support of SAX Parser with ASP

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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, …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now