browser dependent xml?

Discussion in 'XML' started by Henri Sivonen, Jan 8, 2005.

  1. Re: browser INdependent xml?

    In article <cro8mu$37r$>,
    Bob Smith <> wrote:

    > > So, I need a cross-browser way of using xml. Can anyone please direct me
    > > to information about issues with browsers wrt their interpretation of xml.
    > > ( For example the KDE browser ( Konqueror ) can embed xml in html while

    >
    > I meant the other way around, embed html in xml....sorry for the confusion
    >
    > > firefox on windows doesn't do that, leading to browser dependent coding
    > > which is something I want to avoid as long as possible)


    Firefox allows XHTML to be embedded in generic XML. Does KHTML really
    allow tag soup to be embedded in XML?

    Anyway, sending instances of your own XML vocabulary over the wire is a
    bad idea compared to using a well-known vocabulary like XHTML.

    --
    Henri Sivonen

    http://iki.fi/hsivonen/
    Henri Sivonen, Jan 8, 2005
    #1
    1. Advertising

  2. Henri Sivonen

    Bob Smith Guest

    Hello
    I have a situation where i use XML for generating output from a database,
    through a perl application, and out to the browsers. Now it seems like
    browsers interpret the created xml-files differently.

    So, I need a cross-browser way of using xml. Can anyone please direct me to
    information about issues with browsers wrt their interpretation of xml.
    ( For example the KDE browser ( Konqueror ) can embed xml in html while
    firefox on windows doesn't do that, leading to browser dependet coding
    which is something I want to avoid as long as possible)

    some info would be helpful, thank's.
    /Greger
    --
    http://www.gh-webinteractive.com
    Bob Smith, Jan 8, 2005
    #2
    1. Advertising

  3. Henri Sivonen

    Bob Smith Guest

    Re: browser INdependent xml?

    Bob Smith wrote:

    > Hello
    > I have a situation where i use XML for generating output from a database,
    > through a perl application, and out to the browsers. Now it seems like
    > browsers interpret the created xml-files differently.
    >
    > So, I need a cross-browser way of using xml. Can anyone please direct me
    > to information about issues with browsers wrt their interpretation of xml.
    > ( For example the KDE browser ( Konqueror ) can embed xml in html while


    I meant the other way around, embed html in xml....sorry for the confusion

    > firefox on windows doesn't do that, leading to browser dependent coding
    > which is something I want to avoid as long as possible)
    >
    > some info would be helpful, thank's.
    > /Greger


    --
    http://www.gh-webinteractive.com
    Bob Smith, Jan 8, 2005
    #3
  4. Henri Sivonen

    Bob Smith Guest

    Re: browser INdependent xml?

    Henri Sivonen wrote:

    > In article <cro8mu$37r$>,
    > Bob Smith <> wrote:
    >
    >> > So, I need a cross-browser way of using xml. Can anyone please direct
    >> > me to information about issues with browsers wrt their interpretation
    >> > of xml. ( For example the KDE browser ( Konqueror ) can embed xml in
    >> > html while

    >>
    >> I meant the other way around, embed html in xml....sorry for the
    >> confusion
    >>
    >> > firefox on windows doesn't do that, leading to browser dependent coding
    >> > which is something I want to avoid as long as possible)

    >
    > Firefox allows XHTML to be embedded in generic XML. Does KHTML really
    > allow tag soup to be embedded in XML?


    Konqueror allows for example:
    <some_chapter>
    <a href="link to somplace">descriptor</a>
    </some_chapter>
    ....
    konqueror can render & interpret that, doesn't seem like a good idea.
    I'm looking for an XML solution that is completely browser independent.

    any suggestions?

    for now I output the XML files directly to the browsers. Is it a better
    alternative to create the XML files, and hand them over to some templating
    system to create visual stuff for the browser?
    TIA
    /Greger

    >
    > Anyway, sending instances of your own XML vocabulary over the wire is a
    > bad idea compared to using a well-known vocabulary like XHTML.


    >


    --
    http://www.gh-webinteractive.com
    Bob Smith, Jan 8, 2005
    #4
  5. Re: browser INdependent xml?

    Bob Smith wrote:


    > Konqueror allows for example:
    > <some_chapter>
    > <a href="link to somplace">descriptor</a>
    > </some_chapter>
    > ...
    > konqueror can render & interpret that, doesn't seem like a good idea.
    > I'm looking for an XML solution that is completely browser independent.


    Well if you use XML and want to have elements in that with HTML
    semantics then the proper way is to use XHTML with the defined namespace
    e.g.
    <some_chapter>
    <a xmlns="http://www.w3.org/1999/xhtml" href="whatever">descriptor</a>
    </some_chapter>
    then browsers like Mozilla or Opera will recognize the <a> element to be
    in the XHTML namespace and render it as a link.
    Doesn't help with IE however which usually renders XML by transforming
    it to HTML with the help of XSLT.

    > for now I output the XML files directly to the browsers. Is it a better
    > alternative to create the XML files, and hand them over to some templating
    > system to create visual stuff for the browser?


    Sure, currently it makes much more sense to use XML to store your data
    but then to use tools like XSLT on the server to transform the XML to
    some well established and supported document type like HTML 4 served as
    text/html.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 8, 2005
    #5
  6. Henri Sivonen

    Andy Dingley Guest

    On Sat, 08 Jan 2005 11:27:35 +0100, Bob Smith
    <> wrote:

    >So, I need a cross-browser way of using xml.


    Use XSLT on the server to turn it into HTML before serving it.
    Cross-browser accuracy of HTML rendering is hard enough, for XML you
    can just forget it.
    Andy Dingley, Jan 8, 2005
    #6
  7. Henri Sivonen

    Bob Smith Guest

    Re: browser INdependent xml?

    Martin Honnen wrote:

    >
    >
    > Bob Smith wrote:
    >
    >
    >> Konqueror allows for example:
    >> <some_chapter>
    >> <a href="link to somplace">descriptor</a>
    >> </some_chapter>
    >> ...
    >> konqueror can render & interpret that, doesn't seem like a good idea.
    >> I'm looking for an XML solution that is completely browser independent.

    >
    > Well if you use XML and want to have elements in that with HTML
    > semantics then the proper way is to use XHTML with the defined namespace
    > e.g.
    > <some_chapter>
    > <a xmlns="http://www.w3.org/1999/xhtml" href="whatever">descriptor</a>
    > </some_chapter>
    > then browsers like Mozilla or Opera will recognize the <a> element to be
    > in the XHTML namespace and render it as a link.
    > Doesn't help with IE however which usually renders XML by transforming
    > it to HTML with the help of XSLT.
    >
    >> for now I output the XML files directly to the browsers. Is it a better
    >> alternative to create the XML files, and hand them over to some
    >> templating system to create visual stuff for the browser?

    >
    > Sure, currently it makes much more sense to use XML to store your data
    > but then to use tools like XSLT on the server to transform the XML to
    > some well established and supported document type like HTML 4 served as
    > text/html.
    >

    thank you (all) for your input to the discussion.
    right, so I am new to both XML and XSLT.
    what tools /converters do I need on the server side to do transfer XML with
    XSLT to (X)HTML?
    ( using linux S.u.S.E. )
    best r
    Greger

    --
    http://www.gh-webinteractive.com
    Bob Smith, Jan 9, 2005
    #7
  8. Re: browser INdependent xml?

    Bob Smith wrote:


    > what tools /converters do I need on the server side to do transfer XML with
    > XSLT to (X)HTML?
    > ( using linux S.u.S.E. )


    It (partly) depends on what you are using on the server, e.g. Java
    (where 1.4 and 1.5 have an XSLT 1.0 processor included), or PHP (where
    PHP 4 has an extension that uses Sablotron I think and PHP 5 uses
    libxslt) or Perl (which I think can use different XSLT processors
    written in C or C++ if wrappers are provided).
    One URL to start with if you are using Apache could be
    <http://xml.apache.org/>


    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jan 9, 2005
    #8
  9. Re: browser INdependent xml?

    In article <41e11ef6$0$17052$-online.net>,
    Martin Honnen <> wrote:

    > Bob Smith wrote:
    >
    >
    > > what tools /converters do I need on the server side to do transfer XML with
    > > XSLT to (X)HTML?
    > > ( using linux S.u.S.E. )

    >
    > It (partly) depends on what you are using on the server, e.g. Java
    > (where 1.4 and 1.5 have an XSLT 1.0 processor included)


    XSLT transformation to XHTML does not guarantee Appendix C
    compatibility. To go from XHTML to HTML in Java, you could use a SAX
    serializer like this:
    http://iki.fi/hsivonen/cms/src/fi/iki/hsivonen/xml/HtmlSerializer.java

    --
    Henri Sivonen

    http://iki.fi/hsivonen/
    Henri Sivonen, Jan 9, 2005
    #9
  10. Martin Honnen, Jan 9, 2005
    #10
  11. Henri Sivonen

    Nick Kew Guest

    Re: browser INdependent xml?

    In article <>,
    Henri Sivonen <> writes:
    >> > what tools /converters do I need on the server side to do transfer XML with
    >> > XSLT to (X)HTML?
    >> > ( using linux S.u.S.E. )

    >>
    >> It (partly) depends on what you are using on the server, e.g. Java
    >> (where 1.4 and 1.5 have an XSLT 1.0 processor included)

    >
    > XSLT transformation to XHTML does not guarantee Appendix C
    > compatibility.


    If web browsers are your concern, XSLT can generate (X-less) HTML.

    If for any reason you need to stick with XHTML and ensure Appendix-C
    compliance, use mod_xhtml.

    --
    Nick Kew
    Nick Kew, Jan 9, 2005
    #11
  12. Re: browser INdependent xml?

    In article <41e147a3$0$17075$-online.net>,
    Martin Honnen <> wrote:

    > Henri Sivonen wrote:
    >
    >
    > > XSLT transformation to XHTML does not guarantee Appendix C
    > > compatibility. To go from XHTML to HTML in Java, you could use a SAX
    > > serializer like this:
    > > http://iki.fi/hsivonen/cms/src/fi/iki/hsivonen/xml/HtmlSerializer.java

    >
    > But that creates HTML 4.01 so it doesn't help with getting "XHTML
    > Appendix C compatibility", or does it?


    No, but it helps with getting something that is appropriate for serving
    as text/html.

    --
    Henri Sivonen

    http://iki.fi/hsivonen/
    Henri Sivonen, Jan 9, 2005
    #12
  13. Re: browser INdependent xml?

    In article <>,
    (Nick Kew) wrote:

    > If web browsers are your concern, XSLT can generate (X-less) HTML.


    But then if you want to add the X, you need changes to the
    transformation, right? That's why I'd rather write the transformation to
    target XHTML, take SAX output from the XSLT engine and use a SAX to HTML
    serializer.

    --
    Henri Sivonen

    http://iki.fi/hsivonen/
    Henri Sivonen, Jan 9, 2005
    #13
  14. Henri Sivonen

    Peter Flynn Guest

    Re: browser INdependent xml?

    Bob Smith wrote:

    > what tools /converters do I need on the server side to do transfer XML
    > with XSLT to (X)HTML?
    > ( using linux S.u.S.E. )


    It depends if you want to do a static transformation and have Apache serve
    the resulting HTML from disk in the normal way, or have the transformation
    done in real time afresh every time the document changes (ie static docs or
    fast-changing docs), or if the XML document is itself dynamically generated
    (eg from a database or data stream or feed).

    For traditional text documents (slow changing, if ever), I use Saxon. With
    one or two trivially small exceptions it has been massively reliable.

    I have tried AxKit (freebie for Perl and Apache) and I got it to work once,
    but the authors don't have access to recent versions of operating systems,
    so I haven't been able to get it running under RH9 or FC3 yet. Maybe it
    works with SuSE. It's a small, light, realtime XML-XSLT server driver.

    For dynamic configurations I prefer Cocoon, but there are performance
    limitations (like most Java server applications, Cocoon with Tomcat
    tends to spawn processes like tadpoles on a warm summer morning, and
    some of them are persistent little buggers).

    For higher performance, you may want to look at a commercial solution
    like PropelX (www.propylon.com) or Omnimark (www.stilo.com), or at
    writing some C or Java or JSP or ASP or whatever scripting solution
    you prefer.

    ///Peter
    [Claimer: I have a business relationship with Propylon]
    --
    "The cat in the box is both a wave and a particle"
    -- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
    Peter Flynn, Jan 9, 2005
    #14
  15. Henri Sivonen

    Nick Kew Guest

    Re: browser INdependent xml?

    In article <>,
    Peter Flynn <> writes:
    > Bob Smith wrote:
    >
    >> what tools /converters do I need on the server side to do transfer XML
    >> with XSLT to (X)HTML?
    >> ( using linux S.u.S.E. )

    >
    > It depends if you want to do a static transformation and have Apache serve
    > the resulting HTML from disk in the normal way,


    The effecient way where feasible, of course.

    > or have the transformation
    > done in real time afresh every time the document changes (ie static docs or
    > fast-changing docs), or if the XML document is itself dynamically generated
    > (eg from a database or data stream or feed).


    Unless you're using a non-apache server, the best solution is then an XSLT
    filter module[1] like mod_transform[2] from www.outoforder.cc.

    [1] There are also several modules called mod_xslt. I've used two;
    one worked well, the other was a total nonstarter. YMMV.
    [2] Of which I am co-developer, and which I've been using since 2002.

    --
    Nick Kew
    Nick Kew, Jan 12, 2005
    #15
    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. Andrew Lord
    Replies:
    0
    Views:
    1,036
    Andrew Lord
    Jun 10, 2004
  2. puzzlecracker
    Replies:
    1
    Views:
    507
    James Kanze
    Aug 7, 2008
  3. Erik Wasser
    Replies:
    5
    Views:
    429
    Peter J. Holzer
    Mar 5, 2006
  4. Replies:
    4
    Views:
    191
    Tintin
    Sep 2, 2006
  5. Replies:
    0
    Views:
    128
Loading...

Share This Page