Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > writing out XML with ASP

Reply
Thread Tools

writing out XML with ASP

 
 
cmt
Guest
Posts: n/a
 
      12-12-2007

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!
 
Reply With Quote
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      12-13-2007

"cmt" <> wrote in message
news:3c58b08a-8df6-4de7-9edc-...
>
> 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


 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      12-13-2007
"cmt" <> wrote in message
news:3c58b08a-8df6-4de7-9edc-...
>
> 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


 
Reply With Quote
 
cmt
Guest
Posts: n/a
 
      12-13-2007
On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
> "cmt" <chrismt...@gmail.com> wrote in message
>
> news:3c58b08a-8df6-4de7-9edc-...
>
>
>
>
>
> > 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!
 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      12-14-2007
"cmt" <> wrote in message
news:7f28f716-7b63-4de5-ac57-...
> On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
> > "cmt" <chrismt...@gmail.com> wrote in message
> >
> >

news:3c58b08a-8df6-4de7-9edc-...
> >
> >
> >
> >
> >
> > > 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


 
Reply With Quote
 
cmt
Guest
Posts: n/a
 
      12-17-2007
On Dec 13, 7:00 pm, "Anthony Jones" <A...@yadayadayada.com> wrote:
> "cmt" <chrismt...@gmail.com> wrote in message
>
> news:7f28f716-7b63-4de5-ac57-...> On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
> > > "cmt" <chrismt...@gmail.com> wrote in message

>
> news:3c58b08a-8df6-4de7-9edc-...
>
>
>
>
>
> > > > 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


 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      12-22-2007


"cmt" <> wrote in message
news:2632c527-15e6-4797-9d12-...
> On Dec 13, 7:00 pm, "Anthony Jones" <A...@yadayadayada.com> wrote:
> > "cmt" <chrismt...@gmail.com> wrote in message
> >
> >

news:7f28f716-7b63-4de5-ac57-...>
On Dec 13, 4:15 am, "Anthony Jones" <A...@yadayadayada.com> wrote:
> > > > "cmt" <chrismt...@gmail.com> wrote in message

> >
> >

news:3c58b08a-8df6-4de7-9edc-...
> >
> >
> >
> >
> >
> > > > > 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
problem: writing out an XML file always includes the commented DTD in the beginning. Why? bronski Java 0 02-16-2005 11:43 AM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
Best way to send SOAP Messages to a Web Service by writing out XML Softwaremaker ASP .Net Web Services 4 08-02-2004 04:39 PM
Writing a gui to map foreign XML <> local XML in python Christopher Boomer XML 0 07-28-2003 02:26 PM



Advertisments