writing out XML with ASP

Discussion in 'ASP General' started by cmt, Dec 12, 2007.

  1. cmt

    cmt Guest

    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!
     
    cmt, Dec 12, 2007
    #1
    1. Advertising

  2. cmt

    Mr. Arnold Guest

    "cmt" <> wrote in message
    news:...
    >
    > 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
     
    Mr. Arnold, Dec 13, 2007
    #2
    1. Advertising

  3. "cmt" <> wrote in message
    news:...
    >
    > 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
     
    Anthony Jones, Dec 13, 2007
    #3
  4. cmt

    cmt Guest

    On Dec 13, 4:15 am, "Anthony Jones" <> wrote:
    > "cmt" <> wrote in message
    >
    > news:...
    >
    >
    >
    >
    >
    > > 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!
     
    cmt, Dec 13, 2007
    #4
  5. "cmt" <> wrote in message
    news:...
    > On Dec 13, 4:15 am, "Anthony Jones" <> wrote:
    > > "cmt" <> wrote in message
    > >
    > >

    news:...
    > >
    > >
    > >
    > >
    > >
    > > > 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
     
    Anthony Jones, Dec 14, 2007
    #5
  6. cmt

    cmt Guest

    On Dec 13, 7:00 pm, "Anthony Jones" <> wrote:
    > "cmt" <> wrote in message
    >
    > news:...> On Dec 13, 4:15 am, "Anthony Jones" <> wrote:
    > > > "cmt" <> wrote in message

    >
    > news:...
    >
    >
    >
    >
    >
    > > > > 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
     
    cmt, Dec 17, 2007
    #6
  7. "cmt" <> wrote in message
    news:...
    > On Dec 13, 7:00 pm, "Anthony Jones" <> wrote:
    > > "cmt" <> wrote in message
    > >
    > >

    news:...>
    On Dec 13, 4:15 am, "Anthony Jones" <> wrote:
    > > > > "cmt" <> wrote in message

    > >
    > >

    news:...
    > >
    > >
    > >
    > >
    > >
    > > > > > 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
     
    Anthony Jones, Dec 22, 2007
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HNguyen
    Replies:
    4
    Views:
    2,413
    HNguyen
    Dec 21, 2004
  2. bronski
    Replies:
    0
    Views:
    455
    bronski
    Feb 16, 2005
  3. Christopher Boomer
    Replies:
    0
    Views:
    411
    Christopher Boomer
    Jul 28, 2003
  4. Softwaremaker
    Replies:
    4
    Views:
    302
    Michael Herman \(Parallelspace\)
    Aug 2, 2004
  5. Erik Wasser
    Replies:
    5
    Views:
    468
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page