Re: writing out XML with ASP

Re: writing out XML with ASP

am 22.12.2007 14:06:36 von Anthony Jones

"cmt" wrote in message
news:2632c527-15e6-4797-9d12-d302db864ed4@p1g2000hsb.googleg roups.com...
> On Dec 13, 7:00 pm, "Anthony Jones" wrote:
> > "cmt" wrote in message
> >
> >
news:7f28f716-7b63-4de5-ac57-802979b23391@a35g2000prf.google groups.com...>
On Dec 13, 4:15 am, "Anthony Jones" wrote:
> > > > "cmt" wrote in message
> >
> >
news:3c58b08a-8df6-4de7-9edc-c933b018d3d5@q77g2000hsh.google groups.com...
> >
> >
> >
> >
> >
> > > > > Hi everyone,
> >
> > > > > I have to perform a database query and write the results to an XML
> > > > > file.
> >
> > > > > I also need to form this XML file with a DTD file.
> >
> > > > > I'd like to hear some opinions on the best way to do this.
> >
> > > > > I figured out how to write out just raw XML using adPersistXML.
But
> > > > > that doesn't really help as the XML needs to conform to the DTD.
> >
> > > > > I also found a way to write out the XML file line by line
> > > > > using .createNode and .appendChild...but that would take forever
as
> > > > > the database query returns 72 columns.
> >
> > > > How many rows? How sure are you that it would take too long?
> >
> > > > What DB? E.g. SQL Servers FOR XML isn't blisteringly quick any way
> > (under
> > > > the hood I suspect it still uses createNode etc on an MSXML DOM).
> >
> > > > Have you considered taking the raw XML and using XSL to transform it
to
> > your
> > > > required format with DTD?
> >
> > > > --
> > > > Anthony Jones - MVP ASP/ASP.NET
> >
> > > This will be written in classic ASP and using SQL Server 2000.
> >
> > > There will be about 5000 rows in all.
> >
> > > I'm fairly familiar with XML now, but I really haven't found any
> > > resources on how to create XSL from DTD...
> >
> > > I'd love to be able to take the raw XML and just format it correctly
> > > with the required DTD, but knowledge on how to do this is few and far
> > > between.
> >
> > Since taking the Raw XML as an input and getting XML compliant with your
DTD
> > as an output there is the inescapable requirement for a process to come
> > between them. Said process would have to know how to map the raw XML to
the
> > DTD XML. Since the DTD only defines the output structure but not the
input
> > the DTD alone is not enough. Even given a definition of the Raw
structure
> > there is still a need to define the mapping between the two.
> >
> > XSL is the tool that we use to define the above process.
> >
> > --
> > Anthony Jones - MVP ASP/ASP.NET
>
>
> Would it help if I had the XSD? I have a DTD and an XSD. Would a
> combination of these help with formatting the RAW XML?
>

Not really. Again XSD is simply another way to define the desired output
structure. It does not understand the DB representation of the data
therefore you still have the need to define how to transform the DB data to
the desired XML structure. There is no magic way take a DB schema and a XSD
to have some process automatically know how to map one to another.

--
Anthony Jones - MVP ASP/ASP.NET