DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: XML file and DTD

  1. #1
    Jignesh Guest

    XML file and DTD


    In one of our upcoming projects we are going to use XML to transfer data between
    two processes (NO WEB technology employed here).

    We have a "well formed" document and are wondering whether we should include
    a DTD to make it 'valid'.

    I know that including a DTD in NOT mandatory, but what are the advantages
    of making it 'valid' over keeping it 'well formed'? In our case, only one
    process outputs the file, the other just reads data.

    Any input is appreciated.

    Jignesh


  2. #2
    Russell Jones Guest

    Re: XML file and DTD

    The big advantage of including a DTD (although I'd recommend using a cached
    schema for better performance) is that the parser can do all the work of
    validating the input. For example, suppose you have a function that expects
    four parameters--two strings, each of which must consist of selections from
    a list and may not be empty, a date value, and an integer value. Typically,
    you'd write validation code to check each parameter, but if you use a schema
    or DTD and pass the values in as an XML string, you can rely on the parser
    to perform the validation. You also get a big win if you ever need to make
    changes to the parameter validation requirements; using XML, you would need
    to change only the DTD/Schema rather than modifying the application. The
    downside is, of course, performance. You'll need to test to make sure that
    the performance of a validating parser meets your requirements.

    Russell Jones
    Sr. Web Development Editor
    DevX.com

    "Jignesh" <jpatel@jda.com> wrote in message news:3a5f232f$1@news.devx.com...
    >
    > In one of our upcoming projects we are going to use XML to transfer data

    between
    > two processes (NO WEB technology employed here).
    >
    > We have a "well formed" document and are wondering whether we should

    include
    > a DTD to make it 'valid'.
    >
    > I know that including a DTD in NOT mandatory, but what are the advantages
    > of making it 'valid' over keeping it 'well formed'? In our case, only one
    > process outputs the file, the other just reads data.
    >
    > Any input is appreciated.
    >
    > Jignesh
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center