473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

XML & MSIE: Use of default namespace declaration attribute in DTDnot supported.

When i open the following xml file in internetexplorer:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!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="gastenboek">
<xc:bericht>
<xc:id>1</xc:id>
<xc:naam type="string"><![CDATA[Tjerk Wolterink]]></xc:naam>
<xc:email type="email"><![CDATA[tj***@wolterinkwebdesign.com]]></xc:email>
<xc:rating type="option">
<xc:empty/>
</xc:rating>
<xc:content type="text">
Ik moet zeggen je hebt er een mooi werkje van gemaakt<br />
Zeker dat xml buttontje onderin maakt het compleet
</xc:content>
</xc:bericht>
</xc:xcontent>

Then internet explorer says the following:

------
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------

Use of default namespace declaration attribute in DTD not supported. Error processing resource 'http://tjerk.wolterinkwebde...
------
What am i doing wrong??
Jul 20 '05 #1
6 8214
What am i doing wrong??


Nothing.

When MSXML says

Use of default namespace declaration attribute in DTD not supported.

They mean,
"We know this is a legal construct, but we are not going to support it"
You can modify the xhtml dtd so it does work in IE (eg the XHTML+MathML
one at
http://www.w3.org/Math/DTD/
works
but since your input file clearly isn't XHTML, why have the DTD
reference at all?

David
Jul 20 '05 #2
David Carlisle wrote:
What am i doing wrong??

Nothing.

When MSXML says

Use of default namespace declaration attribute in DTD not supported.

They mean,
"We know this is a legal construct, but we are not going to support it"
You can modify the xhtml dtd so it does work in IE (eg the XHTML+MathML
one at
http://www.w3.org/Math/DTD/
works
but since your input file clearly isn't XHTML, why have the DTD
reference at all?

David

Because it can contain html, the xml is generated from a database,
this xml file is then put in an xsl file, and that xsl file should
not affect the xhtml, and it only works when i use a namespace for xhtml in the xml file.
Jul 20 '05 #3
Tjerk Wolterink <tj***@wolterinkwebdesign.com> writes:
Because it can contain html, the xml is generated from a database,
this xml file is then put in an xsl file, and that xsl file should
not affect the xhtml, and it only works when i use a namespace for xhtml in the xml file.


Yes but unless your DTD reference declares _all_ of the elements used,
not just the XHTML ones, the file will not be dtd-valid anyway so
there's not much to be gained in having a DTD at all.

The only thing that can be gained is defaulting of the xhtml namespace
declarations and that can't be made to work in IE. As the message said
it is an intentional non-conformance by MS.

The namespace Rec incidentally does advise against defaulting namespace
declarations. This also would fail with mozilla, for different reasons,
mozilla does not read external dtd files, so would never see the default
namespace declaration.

Can't you modify your generation from the datatabase so that your top
level element has
xmlns="http://www.w3.org/199/xhtml"
which is all you need to ensure that unprefixed html elements are XHTML
and matched by your stylesheet.

David
Jul 20 '05 #4
David Carlisle wrote:
Tjerk Wolterink <tj***@wolterinkwebdesign.com> writes:

Because it can contain html, the xml is generated from a database,
this xml file is then put in an xsl file, and that xsl file should
not affect the xhtml, and it only works when i use a namespace for xhtml in the xml file.

Yes but unless your DTD reference declares _all_ of the elements used,
not just the XHTML ones, the file will not be dtd-valid anyway so
there's not much to be gained in having a DTD at all.

The only thing that can be gained is defaulting of the xhtml namespace
declarations and that can't be made to work in IE. As the message said
it is an intentional non-conformance by MS.

The namespace Rec incidentally does advise against defaulting namespace
declarations. This also would fail with mozilla, for different reasons,
mozilla does not read external dtd files, so would never see the default
namespace declaration.

Can't you modify your generation from the datatabase so that your top
level element has
xmlns="http://www.w3.org/199/xhtml"
which is all you need to ensure that unprefixed html elements are XHTML
and matched by your stylesheet.

David


i do not follow you there.

My top level element has xmlns="http://www.w3.org/1999/xhtml"

Here look at the xml:

===
<?xml version="1.0" encoding="ISO-8859-1"?>

<!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="gastenboek">
<xc:bericht>
<xc:id>1</xc:id>
<xc:naam type="string"><![CDATA[Tjerk Wolterink]]></xc:naam>
<xc:email type="email"><![CDATA[tj***@wolterinkwebdesign.com]]></xc:email>
<xc:rating type="option">
<xc:empty/>
</xc:rating>
<xc:content type="text">
Ik moet zeggen je hebt er een mooi werkje van gemaakt<br />
Zeker dat xml buttontje onderin maakt het compleet
</xc:content>
</xc:bericht>
</xc:xcontent>
===
I do not have a DTD for the <xc: namespace, i'm planning to build a xsd for the xml format.
But i do use :
<!DOCTYPE xc:content [
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
%xhtml;
]>
Because the <xc:content xml file can contain xhtml entities, if i do not add this doctype declaration
then my xsl parser will complain (the xslt processor does not now &nbsp; therefore i have the doctype declaration).

So what do you exactly mean, how can i solve this problem?

Jul 20 '05 #5
In article <41**********************@news.wanadoo.nl>,
Tjerk Wolterink <tj***@wolterinkwebdesign.com> wrote:
Because the <xc:content xml file can contain xhtml entities, if i do not
add this doctype declaration
then my xsl parser will complain (the xslt processor does not now &nbsp;
therefore i have the doctype declaration).


You can just include the entity definition part of the DTD instead:

<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
"xhtml-lat1.ent">
%HTMLlat1;

<!ENTITY % HTMLsymbol PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;

<!ENTITY % HTMLspecial PUBLIC "-//W3C//ENTITIES Special for XHTML//EN"
"xhtml-special.ent">
%HTMLspecial;

-- Richard
Jul 20 '05 #6
My top level element has xmlns="http://www.w3.org/1999/xhtml"


so it has. Sorry.

Because the <xc:content xml file can contain xhtml entities, if i do not add this doctype declaration
then my xsl parser will complain (the xslt processor does not now &nbsp; therefore i have the doctype declaration).
If you only need the entity definitions then you can just include those,
you don't need the full XHTML dtd

eg:

<!DOCTYPE xc:content [
<!ENTITY % HTMLlat1 PUBLIC
"-//W3C//ENTITIES Latin 1 for XHTML//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">
%HTMLlat1;

<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent">
%HTMLsymbol;

<!ENTITY % HTMLspecial PUBLIC
"-//W3C//ENTITIES Special for XHTML//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent">
%HTMLspecial;
]>
<xc:content...

possibly replacing http://www.w3.org/TR/xhtml1/DTD/ by a URI to a local
copy on your file system, to save hitting a remote server every time.

Or as I say you can use a version of teh XHTMl DTD that works with IE, eg
<!DOCTYPE xc:content SYSTEM "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">"
<xc:content...

but that's a rather big DTD to download every time if you just want the
HTMl entities.

David
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
1
by: indo3 | last post by:
HELLO For the top root element of my schema file, i want to declare following attribute: <xs:attribute name="xmlns:m" type="xs:string" default="http://www.w3.org/1998/Math/MathML"/> But...
3
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
17
by: Torbjørn Pettersen | last post by:
I've got a table where I want some of the cells to use a background image. The cells have variable height, so I am using an image with a rather small height to fill up the background of the cells,...
4
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know...
4
by: Samuel R. Neff | last post by:
I'm writing an xslt in vs.net 2003 and in order to get intellisense on the html content I added the default namespace declaration xmlns="http://schemas.microsoft.com/intellisense/ie5". However,...
7
by: Bilal | last post by:
Hello all, I came across this problem while working out the bugs in my identity trasnformation stylesheets but sidestepped it for later to see if there is an easier/better solution. This is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.