XML: pros and cons

Discussion in 'XML' started by Zhou Lei, Mar 3, 2005.

  1. Zhou Lei

    Zhou Lei Guest

    Hi friends I'm a newbie learning XSLT to transform an XML to some other
    documents. Now I have some questions, anyone could give me some suggestions
    on them?

    1. If we save our documents in XML rules and these files should be published
    on Internet through WWW, what we can benefit from the XML files? And what
    are the drawbacks (is it too complex or time-consuming because we have to
    define a new set of XML elements to save the documents, and write the XSLT
    to transform them to XHTML)? Is it more convenient to use XHTML+CSS?

    2. The transformation from XML to XHTML using XSLT can be completed on
    server side (such as cocoon) or client side. I know transformation on client
    side can bring some compatibility problems because older web browers cannot
    recognise and complete the transformation. But on the other hand,
    transformation on server side may consume the server resources. Are there
    any other advantages/disadvantages for the transformation on
    server-side/client-side and what are they?

    3. During the learning process, I touched some small exercises on the DTD to
    define the XML elements, and I found it sufficient to describe the XML tree
    structure and I don't know why we introduced a new Schema to replace DTD.
    What are the advantages of using Schema, besides it is written in XML? And
    where can I find the Schema is more powerful and flexible than DTD?

    Thank you all,

    Regards,
     
    Zhou Lei, Mar 3, 2005
    #1
    1. Advertising

  2. Zhou Lei

    Mukul Gandhi Guest

    "Zhou Lei" <> wrote in message news:<d083i4$c52>

    > 1. If we save our documents in XML rules and these files should be published
    > on Internet through WWW, what we can benefit from the XML files? And what
    > are the drawbacks (is it too complex or time-consuming because we have to
    > define a new set of XML elements to save the documents, and write the XSLT
    > to transform them to XHTML)? Is it more convenient to use XHTML+CSS?
    >

    In HTML you can directly specify presentation(like bold text,
    hyperlinks etc..) along with data. If your objective is just to
    publish information on web, I feel HTML is a good choice. You can
    easily create HTML in popular HTML editors and serve it via a standard
    web server. Publishing content via HTML has no transformation overhead
    (which XSLT has). But if you are getting XML generated by some
    application and need to show it on web, then definitely you have to
    transform it into HTML. This you can do using CSS or XSLT. CSS would
    allow you to add advanced presentation to HTML (but would not provide
    advanced transformation capability as XSLT does). XSLT would allow you
    to perform advanced transformation/filtering/calculations on XML. You
    can apply XSLT on the server side or client side. The server side
    approach will be ideal if your goal is to cater to all the browsers.
    As not all browsers support XSLT in the same way. You may even combine
    CSS and XSLT (both on server as well as client side). The choice will
    depend upon exact requirement..

    > 2. The transformation from XML to XHTML using XSLT can be completed on
    > server side (such as cocoon) or client side. I know transformation on client
    > side can bring some compatibility problems because older web browers cannot
    > recognise and complete the transformation. But on the other hand,
    > transformation on server side may consume the server resources. Are there
    > any other advantages/disadvantages for the transformation on
    > server-side/client-side and what are they?
    >

    The XSLT transformation on server side is advantageous if you need to
    cater to all browsers (as server will send only HTML to the browsers).
    If your need to cater to maximum clients is of utmost importance, then
    you have to bear the transformation overhead! But today server
    platforms are quite powerful, so I feel it should not be problem.. The
    advantage of XSLT processing on client side would be benificial,
    because it will relieve the server from transformation overhead (Also
    you will not need to install any additional software like XSLT
    processor, JVM etc.. You can just place XML and XSLT files on web
    server, and they will be served to client over standard HTTP protocol,
    where transformation will be performed)

    > 3. During the learning process, I touched some small exercises on the DTD to
    > define the XML elements, and I found it sufficient to describe the XML tree
    > structure and I don't know why we introduced a new Schema to replace DTD.
    > What are the advantages of using Schema, besides it is written in XML? And
    > where can I find the Schema is more powerful and flexible than DTD?

    XML Schema is definitely more advantageous than DTD. You can specify
    more constraints on XML using Schema than DTD. It provides useful data
    type system, which allows you to specify data types on XML elements..
    Data typing is quite useful, as it helps to eliminate bugs at a very
    early stage of application development.. DTD has a very restricted
    type system.. Having meta-data about XML in XML format(i.e. XML
    Schema) has various other advantages.. You can manipulate XML Schema
    using standard XML parsers, and can do XSLT transformations on them..

    I think I have only mentioned few of the points!

    Regards,
    Mukul
     
    Mukul Gandhi, Mar 4, 2005
    #2
    1. Advertising

  3. Zhou Lei

    Zhou Lei Guest

    "Mukul Gandhi" <> ????
    news:...
    > "Zhou Lei" <> wrote in message news:<d083i4$c52>
    >
    > > 1. If we save our documents in XML rules and these files should be

    published
    > > on Internet through WWW, what we can benefit from the XML files? And

    what
    > > are the drawbacks (is it too complex or time-consuming because we have

    to
    > > define a new set of XML elements to save the documents, and write the

    XSLT
    > > to transform them to XHTML)? Is it more convenient to use XHTML+CSS?
    > >

    > In HTML you can directly specify presentation(like bold text,
    > hyperlinks etc..) along with data. If your objective is just to
    > publish information on web, I feel HTML is a good choice. You can
    > easily create HTML in popular HTML editors and serve it via a standard
    > web server. Publishing content via HTML has no transformation overhead
    > (which XSLT has). But if you are getting XML generated by some
    > application and need to show it on web, then definitely you have to
    > transform it into HTML. This you can do using CSS or XSLT. CSS would
    > allow you to add advanced presentation to HTML (but would not provide
    > advanced transformation capability as XSLT does). XSLT would allow you
    > to perform advanced transformation/filtering/calculations on XML. You
    > can apply XSLT on the server side or client side. The server side
    > approach will be ideal if your goal is to cater to all the browsers.
    > As not all browsers support XSLT in the same way. You may even combine
    > CSS and XSLT (both on server as well as client side). The choice will
    > depend upon exact requirement..
    >
    > > 2. The transformation from XML to XHTML using XSLT can be completed on
    > > server side (such as cocoon) or client side. I know transformation on

    client
    > > side can bring some compatibility problems because older web browers

    cannot
    > > recognise and complete the transformation. But on the other hand,
    > > transformation on server side may consume the server resources. Are

    there
    > > any other advantages/disadvantages for the transformation on
    > > server-side/client-side and what are they?
    > >

    > The XSLT transformation on server side is advantageous if you need to
    > cater to all browsers (as server will send only HTML to the browsers).
    > If your need to cater to maximum clients is of utmost importance, then
    > you have to bear the transformation overhead! But today server
    > platforms are quite powerful, so I feel it should not be problem.. The
    > advantage of XSLT processing on client side would be benificial,
    > because it will relieve the server from transformation overhead (Also
    > you will not need to install any additional software like XSLT
    > processor, JVM etc.. You can just place XML and XSLT files on web
    > server, and they will be served to client over standard HTTP protocol,
    > where transformation will be performed)
    >
    > > 3. During the learning process, I touched some small exercises on the

    DTD to
    > > define the XML elements, and I found it sufficient to describe the XML

    tree
    > > structure and I don't know why we introduced a new Schema to replace

    DTD.
    > > What are the advantages of using Schema, besides it is written in XML?

    And
    > > where can I find the Schema is more powerful and flexible than DTD?

    > XML Schema is definitely more advantageous than DTD. You can specify
    > more constraints on XML using Schema than DTD. It provides useful data
    > type system, which allows you to specify data types on XML elements..
    > Data typing is quite useful, as it helps to eliminate bugs at a very
    > early stage of application development.. DTD has a very restricted
    > type system.. Having meta-data about XML in XML format(i.e. XML
    > Schema) has various other advantages.. You can manipulate XML Schema
    > using standard XML parsers, and can do XSLT transformations on them..
    >
    > I think I have only mentioned few of the points!
    >
    > Regards,
    > Mukul


    Thanks for your reply, I think I will continue to learn Schema...
     
    Zhou Lei, Mar 5, 2005
    #3
    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. Kumar Vijay Mishra

    PSL pros and cons

    Kumar Vijay Mishra, Sep 29, 2004, in forum: VHDL
    Replies:
    2
    Views:
    2,609
    vhdlcohen
    Oct 2, 2004
  2. Benny
    Replies:
    1
    Views:
    436
    Paul Wistrand
    Mar 1, 2004
  3. J.S.
    Replies:
    10
    Views:
    6,097
    shawpnendu
    May 20, 2009
  4. Randall Parker

    Pros and cons for using https on a logon page?

    Randall Parker, Dec 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    767
    nimd4
    May 17, 2014
  5. Maric Michaud

    threading and multicores, pros and cons

    Maric Michaud, Feb 14, 2007, in forum: Python
    Replies:
    24
    Views:
    1,168
    Paul Boddie
    Feb 20, 2007
Loading...

Share This Page