writing out XML with ASP

C

cmt

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.

Any ideas would be greatly appreciated!

Thanks!
 
M

Mr. Arnold

cmt said:
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.

Any ideas would be greatly appreciated!


You can create a Dataset from the query, and you can write the dataset out
in XML, if you're using .NET
 
A

Anthony Jones

cmt said:
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?
 
C

cmt

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?

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.

Thanks!
 
A

Anthony Jones

cmt said:
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.
 
C

cmt

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.


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?

Thanks
 
A

Anthony Jones

cmt said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top