469,323 Members | 1,427 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

writing out XML with ASP

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!
Dec 12 '07 #1
7 1729

"cmt" <ch********@gmail.comwrote in message
news:3c**********************************@q77g2000 hsh.googlegroups.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.

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
Dec 13 '07 #2
"cmt" <ch********@gmail.comwrote in message
news:3c**********************************@q77g2000 hsh.googlegroups.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
Dec 13 '07 #3
cmt
On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.comwrote:
"cmt" <chrismt...@gmail.comwrote in message

news:3c**********************************@q77g2000 hsh.googlegroups.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.

Thanks!
Dec 13 '07 #4
"...the XML needs to conform to the DTD..."

try posting this question to the XML folks

microsoft.public.xml
Dec 13 '07 #5
"cmt" <ch********@gmail.comwrote in message
news:7f**********************************@a35g2000 prf.googlegroups.com...
On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.comwrote:
"cmt" <chrismt...@gmail.comwrote in message
news:3c**********************************@q77g2000 hsh.googlegroups.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
Dec 14 '07 #6
cmt
On Dec 13, 7:00 pm, "Anthony Jones" <A...@yadayadayada.comwrote:
"cmt" <chrismt...@gmail.comwrote in message

news:7f**********************************@a35g2000 prf.googlegroups.com...On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.comwrote:
"cmt" <chrismt...@gmail.comwrote in message

news:3c**********************************@q77g2000 hsh.googlegroups.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?

Thanks
Dec 17 '07 #7


"cmt" <ch********@gmail.comwrote in message
news:26**********************************@p1g2000h sb.googlegroups.com...
On Dec 13, 7:00 pm, "Anthony Jones" <A...@yadayadayada.comwrote:
"cmt" <chrismt...@gmail.comwrote in message
news:7f**********************************@a35g2000 prf.googlegroups.com...>
On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.comwrote:
"cmt" <chrismt...@gmail.comwrote in message
news:3c**********************************@q77g2000 hsh.googlegroups.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
Dec 22 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

48 posts views Thread by Joseph | last post: by
6 posts views Thread by Sebastian Kemi | last post: by
3 posts views Thread by ishekar | last post: by
5 posts views Thread by Jeong-Gun Lee | last post: by
16 posts views Thread by Claudio Grondi | last post: by
6 posts views Thread by arne.muller | last post: by
3 posts views Thread by Barry Flynn | last post: by
89 posts views Thread by Skybuck Flying | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.