browser dependent xml?

H

Henri Sivonen

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)
[/QUOTE]

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.
 
B

Bob Smith

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
 
B

Bob Smith

Bob said:
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
 
B

Bob Smith

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

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

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
 
M

Martin Honnen

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.
 
A

Andy Dingley

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.
 
B

Bob Smith

Martin said:
Bob Smith wrote:



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.


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
 
M

Martin Honnen

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/>
 
N

Nick Kew

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.
 
H

Henri Sivonen

Martin Honnen said:
Henri Sivonen wrote:



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.
 
H

Henri Sivonen

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.
 
P

Peter Flynn

Bob said:
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]
 
N

Nick Kew

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top