XML: pros and cons

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Zhou Lei

    XML: pros and cons

    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,


  • Mukul Gandhi

    #2
    Re: XML: pros and cons

    "Zhou Lei" <dark_eaglet@ho tmail.com> wrote in message news:<d083i4$c5 2>
    [color=blue]
    > 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?
    >[/color]
    In HTML you can directly specify presentation(li ke 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..
    [color=blue]
    > 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?
    >[/color]
    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)
    [color=blue]
    > 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?[/color]
    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

    Comment

    • Zhou Lei

      #3
      Re: XML: pros and cons


      "Mukul Gandhi" <mukul_gandhi@y ahoo.com> ????
      news:b1634669.0 503032122.7e0ea d6a@posting.goo gle.com...[color=blue]
      > "Zhou Lei" <dark_eaglet@ho tmail.com> wrote in message news:<d083i4$c5 2>
      >[color=green]
      > > 1. If we save our documents in XML rules and these files should be[/color][/color]
      published[color=blue][color=green]
      > > on Internet through WWW, what we can benefit from the XML files? And[/color][/color]
      what[color=blue][color=green]
      > > are the drawbacks (is it too complex or time-consuming because we have[/color][/color]
      to[color=blue][color=green]
      > > define a new set of XML elements to save the documents, and write the[/color][/color]
      XSLT[color=blue][color=green]
      > > to transform them to XHTML)? Is it more convenient to use XHTML+CSS?
      > >[/color]
      > In HTML you can directly specify presentation(li ke 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..
      >[color=green]
      > > 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[/color][/color]
      client[color=blue][color=green]
      > > side can bring some compatibility problems because older web browers[/color][/color]
      cannot[color=blue][color=green]
      > > recognise and complete the transformation. But on the other hand,
      > > transformation on server side may consume the server resources. Are[/color][/color]
      there[color=blue][color=green]
      > > any other advantages/disadvantages for the transformation on
      > > server-side/client-side and what are they?
      > >[/color]
      > 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)
      >[color=green]
      > > 3. During the learning process, I touched some small exercises on the[/color][/color]
      DTD to[color=blue][color=green]
      > > define the XML elements, and I found it sufficient to describe the XML[/color][/color]
      tree[color=blue][color=green]
      > > structure and I don't know why we introduced a new Schema to replace[/color][/color]
      DTD.[color=blue][color=green]
      > > What are the advantages of using Schema, besides it is written in XML?[/color][/color]
      And[color=blue][color=green]
      > > where can I find the Schema is more powerful and flexible than DTD?[/color]
      > 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[/color]

      Thanks for your reply, I think I will continue to learn Schema...


      Comment

      Working...