Why does a browser dispaly this as xhtml

T

Tjerk Wolterink

Why o Why does a browser treat this xml file as an xhtml file.


<!DOCTYPE xc:content [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

<xc:xcontent xmlns:xc="http://www.wolterinkwebdesign.com/xml/xcontent" xmlns="http://www.w3.org/1999/xhtml" module="news">
<xc:nieuwsbericht>
<xc:id>1</xc:id>
<xc:title type="string"><![CDATA[Rob H slaat busruit kapot]]></xc:title>
<xc:date type="date"><![CDATA[2004-01-26]]></xc:date>
<xc:plaatje type="img"> <xc:empty/></xc:plaatje>

<xc:content type="html">
<p>Het kan &nbsp; ook neit naders, robh slaat de<em> busruit ui de</em> gelersch taxi, kerls wat is die kerls <strong>stark</strong> <img src="/xcm_v1.0/js/fck_editor/editor/images/smiley/msn/wink_smile.gif" border="0" alt=""/></p>
</xc:content>

</xc:nieuwsbericht>
</xc:xcontent>




I think i know why, because i included xhtml entities.
But i think the browser shoudl not show this as xhtml. Why does it do that!!?1
 
M

Martin Honnen

Tjerk said:
Why o Why does a browser treat this xml file as an xhtml file.


<!DOCTYPE xc:content [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

<xc:xcontent xmlns:xc="http://www.wolterinkwebdesign.com/xml/xcontent"
xmlns="http://www.w3.org/1999/xhtml" module="news">
^^^^^^^^^^^^^^^^^^^^^^^^^^^ XHTML namespace as default namespace
<xc:nieuwsbericht>
<xc:id>1</xc:id>
<xc:title type="string"><![CDATA[Rob H slaat busruit
kapot]]></xc:title>
<xc:date type="date"><![CDATA[2004-01-26]]></xc:date>
<xc:plaatje type="img"> <xc:empty/></xc:plaatje>

<xc:content type="html">
<p>Het kan &nbsp; ook neit naders, robh slaat de<em> busruit
ui de</em> gelersch taxi, kerls wat is die kerls <strong>stark</strong>
<img
src="/xcm_v1.0/js/fck_editor/editor/images/smiley/msn/wink_smile.gif"
border="0" alt=""/></p>

Elements in the default namespace which the browser thinks it knows
about and can render as XHTML elements, it then probably does so.

So I guess (you haven't told us excactly what is happening) that the
browser treats the document as an XML document containing some XHTML
elements which it renders as such, displaying the text content of
elemens in a namespace the browser doesn't know. I don't think it is
treated as a complete XHTML document.
If that is Mozilla, what does page info says?
 
T

Tjerk Wolterink

Martin said:
Tjerk said:
Why o Why does a browser treat this xml file as an xhtml file.


<!DOCTYPE xc:content [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>

<xc:xcontent xmlns:xc="http://www.wolterinkwebdesign.com/xml/xcontent"
xmlns="http://www.w3.org/1999/xhtml" module="news">

^^^^^^^^^^^^^^^^^^^^^^^^^^^ XHTML namespace as default namespace
<xc:nieuwsbericht>
<xc:id>1</xc:id>
<xc:title type="string"><![CDATA[Rob H slaat busruit
kapot]]></xc:title>
<xc:date type="date"><![CDATA[2004-01-26]]></xc:date>
<xc:plaatje type="img"> <xc:empty/></xc:plaatje>

<xc:content type="html">
<p>Het kan &nbsp; ook neit naders, robh slaat de<em>
busruit ui de</em> gelersch taxi, kerls wat is die kerls
<strong>stark</strong> <img
src="/xcm_v1.0/js/fck_editor/editor/images/smiley/msn/wink_smile.gif"
border="0" alt=""/></p>


Elements in the default namespace which the browser thinks it knows
about and can render as XHTML elements, it then probably does so.

So I guess (you haven't told us excactly what is happening

It displays the same as a xhtml document like this (just the body):

<body>
Rob H slaat busruit kapot 2004-01-26
<p>Het kan &nbsp; ook neit naders, robh slaat de<em>
busruit ui de</em> gelersch taxi, kerls wat is die kerls
<strong>stark</strong> <img src="/xcm_v1.0/js/fck_editor/editor/images/smiley/msn/wink_smile.gif"
) that the
browser treats the document as an XML document containing some XHTML
elements which it renders as such, displaying the text content of
elemens in a namespace the browser doesn't know.
True

I don't think it is
treated as a complete XHTML document.
If that is Mozilla, what does page info says?

Type= text/xml

But it would be usefull for me if it renders it like a tree, like when it does
when the document does not contains any xhtml elements.

I think this is just an implementation design choice of the browser-programmers.
Too bad they didnt do it my way! :)
 
M

Martin Honnen

Tjerk Wolterink wrote:

But it would be usefull for me if it renders it like a tree, like when
it does
when the document does not contains any xhtml elements.

I think this is just an implementation design choice of the
browser-programmers.
Too bad they didnt do it my way! :)

Not sure if Mozilla can be configured to do different, you might want to
ask in a Mozilla group. But of course it will be difficult to define
what kind of documents should be "tree rendered" and which not, Mozilla
supports at least XHTML and MathML elements, special builds SVG or
XForms too.
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top