Results 1 to 4 of 4

Thread: Looking for XML tools.

  1. #1

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Looking for XML tools.

    Folks,
    The current requirement in my shop is

    1) Connect to a source database.
    2) Write a query to fetch data.
    3) Use an existing XSD file.
    4) Transform the data in the source table using the XSD and then create an XML file.

    I have been using a trial version of Pervasive SQL to evaluate if this is the tool for our job.

    This works for simple tables, but I haven't worked out a mechanism to apply this to a hierarchical structure.

    To give you an example.
    Code:
    Table tbStudent
    StudentID number,
    StudentName varchar2(100)
    StudentDob date
    ClassroomId Number
    
    Table tbTeacher
    TeacherID number
    TeacherName varchar2(100)
    ClassRoomId number
    
    Table tbClassroom
    ClassroomID number
    ClassroomName varchar2(100)
    I can easily create three XML files from these three tables using the Data Integrator product.

    If I had to create a file which were to have a nested structure like
    PHP Code:
    <CLASSROOM ID "1" NAME="FIFTH B">
     <
    TEACHER NAME="Mr Smith"/>
     <
    STUDENT>
      <
    ID="100"/><NAME="John Jones"/><DOB="01-01-2001"/>
    </
    STUDENT>
     <
    STUDENT>
      <
    ID="101"/><NAME="Jane Jones"/><DOB="01-01-2002"/>
    </
    STUDENT>
    </
    CLASSROOM
    This is the structure I am trying to reproduce.

    One way would be a manual way and write a script. This is the painful route that I would like to avoid, since the actual structure has several levels of nesting. Do you have any tools that you can recommend?
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  2. #2
    Code Monkey wild_bill's Avatar
    Join Date
    Mar 2005
    Location
    Montana
    Posts
    2,993

    Re: Looking for XML tools.

    Check out xsd.exe. It lets you generate an XSD file, and .NET classes given your xml. Then all you should need to do is populate your .net classes from your database, and utilize .NET XML serialization.

    http://www.vbforums.com/showthread.p...hlight=xsd.exe
    That is the very essence of human beings and our very unique capability to perform complex reasoning and actually use our perception to further our understanding of things. We like to solve problems. -Kleinma

    Does your code in post #46 look like my code in #45? No, it doesn't. Therefore, wrong is how it looks. - jmcilhinney

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Looking for XML tools.

    As any XML validator will quickly tell you, your sample is not XML. It kind of looks like XML but it has numerous errors.

    http://www.xmlvalidation.com/
    http://www.validome.org/xml/
    http://www.w3schools.com/xml/xml_validator.asp

  4. #4

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Re: Looking for XML tools.

    Quote Originally Posted by dilettante View Post
    As any XML validator will quickly tell you, your sample is not XML. It kind of looks like XML but it has numerous errors.

    http://www.xmlvalidation.com/
    http://www.validome.org/xml/
    http://www.w3schools.com/xml/xml_validator.asp
    I typed that for an example. I didn't run it through a validator.
    We are planning to go ahead with Pervasive Data Integrator.
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width