Re: Parsing large amounts of data (200,000 entries) with XML?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Joseph M. Ferris (josephmferris_at_cox.net)
Date: 03/17/04


Date: Wed, 17 Mar 2004 15:31:50 -0700

Bonj wrote:

> Right, so the XML file contains the data, the XSL file contains the
> formatting and style options...OK, just a couple of questions:
> a) presumably now then, I can fairly easily enough generate a routine that
> will programatically generate an XML file for whatever data I want that is
> in the form of an SQL-generated recordset (also see my other post - does SQL
> server do this automatically if I set it up right maybe?)

SQL Server currently can do this without any configuration changes.
Actually, it is ADO that does it. ;-) ADO can persist a recordset
directly to XML since version 2.5, I believe.

Once you retrieve a recordset, you can save it via:

rstMyRecordset.save "myxmldocument.xml", adPersistXML

or

rstMyRecordset.save stmLocalStream, adPersistXML

It will treat a string as the first argument as a physical location to
save a file to and an ADO Stream object as a place to write the XML to
directly.

> b) Can I do something similar for the XSL file, in a similar way in which if
> I wanted to generate some HTML I might use FrontPage?

Sorry, I am not sure what you mean here. I have not used FrontPage or
FrontPage Extensions. If you are asking if you can generate an XSL on
the fly, the answer would be yes. An XSL is a well-formed XML document,
so you can build and load it directly into the parser.

> c) I notice that you use the save method of the DOMDocument30 - if I wanted
> to use such methods in an ASP-style system, would I write to a temporary
> file on the web server, or does it have some other method for generating the
> text?

Actually, this sample is the first one I posted. I made a couple of
revisions to it since then. As opposed to saving the result with the
parser, I would recommend either using an ADO Stream object or regular
disk i/o, since the parser was not friendly to Larry's HTML results with
non-breaking spaces. FWIW, if you would use the save method of the
parser on the server, it would save the file locally to the server.

The full listing with all of the current code is in this post (made just
for you - it uses late binding <g>):

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=uvnexUDDEHA.3064%40tk2msftngp13.phx.gbl

--Joseph



Relevant Pages

  • Re: Instantiating objects from XML
    ... I had a simular situation where I needed to process XML to instantiate ... writing your own parser is ... Dolphin on the server side via Apache and FastCGI. ...
    (comp.lang.smalltalk.dolphin)
  • Re: Biztalk 2002 XML Intermittent Parsing error
    ... "A BizTalk Enthusiast" ... > The XML parser is at the top of the Parser List in Biztalk. ... > Biztalk server and SQL with the Biztalk DB's are on the same standalone ...
    (microsoft.public.biztalk.server)
  • CoInitializeEx(), CoUninitialize() and CORBA/threads
    ... My application uses CORBA to communicate between components, and now uses COM to access some libraries (eg. MS XML parser). ... The only sure fire way to do this is for every method in my CORBA server to call CoInitializeExnear the start of the method, ...
    (microsoft.public.vc.language)
  • Re: Duplicate Record with .ADDNEW
    ... If the database server will allow you to create a table without something, ... table there is no possibility of duplicate records. ... field imported from the XML. ... Use the Command object instead. ...
    (microsoft.public.vb.database.ado)
  • RE: XML iFilter needed for SPS 2003 infopath forms?
    ... did in fact need to be installed on the Sharepoint server, ... Apparently the claim that SP indexes xml files is not quite specific enough. ... It must use a default text Filter not a true xml ifilter. ...
    (microsoft.public.sharepoint.portalserver)