473,401 Members | 2,125 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,401 software developers and data experts.

IE Error: Reference to undeclared namespace prefix

Hello newsgroup,

i'm new to xml - what's wrong with this piece code here?

i have these two files:

test.xml
----
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE a SYSTEM "test.ent" [
<!ELEMENT a (ANY)>
<!ATTLIST a
xmlns:xxx CDATA #FIXED "hello"

]>
<a xmlns:xxx="hello">
&hello;
</a>
====
test.ent
----
<?xml version="1.0" encoding="utf-8"?>
<!ENTITY % prefix "xxx:">
<!ENTITY hello "<%prefix;hello/>">
====

The IE6 throws the error 'Reference to undeclared namespace prefix'.

If i change the the prefix to '<!ENTITY % prefix "">' the output is
----
<a xmlns:xxx="hello">
<hello/>
</a>
====

What am I missing?

Thanks. romeo

--
Romeo Disca
Email: ro*********@t-online.de
Jul 20 '05 #1
1 7274
Try this simpler example:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xxx:a [
<!ELEMENT xxx:a (#PCDATA)>
<!ATTLIST xxx:a xmlns:xxx CDATA #FIXED "hello">
] >
<xxx:a> Here are the goodies </xxx:a>

where it is easier to see that the XML is valid. See what IE gives you.

The XML Plug-in in jEdit has no problem with this.

The IE failure appears to be a bug in the way one of the Microsoft libraries
handles namespaces in conjunction with default attributes #FIXED by the DTD.
(I suspect a library because CookTop makes the same error when an xmlns
attribute is defaulted.)

I ran into this last week. I checked the namespace specification. It is
clear that it is necessary to deal with default attributes properly in a
validating XML processor that is namespace aware.

(Note that a namespace-unaware but validating processor will also accept the
document as I have defined it.)

The W3C Schema Validator at http://www.w3.org/2001/03/webdata/xsv processes
the above example and complains about not being able to find a schema at URI
"hello" but then it does lax validation and accepts the document.

-- orcmid

PS: Your use of ANY as a way to allow <hello> (or <xxx:hello>) elements is
incorrect. All elements in the document must be defined by <!ELEMENT >
definitions in a valid XML document. ANY does not extend to elements that
have no markup declaration in the DTD. -- dh

"Romeo Disca" <ro*********@t-online.de> wrote in message
news:bi*************@news.t-online.com...
Hello newsgroup,

i'm new to xml - what's wrong with this piece code here?

i have these two files:

test.xml
----
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE a SYSTEM "test.ent" [
<!ELEMENT a (ANY)>
<!ATTLIST a
xmlns:xxx CDATA #FIXED "hello"

]>
<a xmlns:xxx="hello">
&hello;
</a>
====
test.ent
----
<?xml version="1.0" encoding="utf-8"?>
<!ENTITY % prefix "xxx:">
<!ENTITY hello "<%prefix;hello/>">
====

The IE6 throws the error 'Reference to undeclared namespace prefix'.

If i change the the prefix to '<!ENTITY % prefix "">' the output is
----
<a xmlns:xxx="hello">
<hello/>
</a>
====

What am I missing?

Thanks. romeo

--
Romeo Disca
Email: ro*********@t-online.de

Jul 20 '05 #2

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

Similar topics

7
by: Ensoul Chee | last post by:
I used #include <iostream.h> int m; cout << "Hexadecimal == 0x" << hex << m << endl; to print value of m in hexadecimal mode. But I got the compile error like this couttest.cpp:20 `hex'...
2
by: Herbert Straub | last post by:
What could be wrong with this simple test program: #include <string> #include <iostream> class foo { std::string s; public: foo (const char *a) : s(a) {};
3
by: Materialised | last post by:
I am having some issues with the following code, basically what I am trying to do, is familierise myself with compiler warnings, when I try to access a private or protected class function. Here is...
5
by: SenthilSS | last post by:
My application produces XML Data files which have XML namespace qualified XML elements (nodes), but the namespace itself is not declared in the data file. My task is to read these data files in a...
4
by: Stephen Corey | last post by:
I've got 2 classes in 2 seperate header files, but within the same namespace. If I use a line like: // This code is inside Class2's header file Class1 *newitem = new Class1(param1, param2); ...
4
by: XML newbie: Urgent pls help! | last post by:
I am using VB.Net. My program is to connect to a remote IPAddress. Once, it verifies the login information it should display the SessionID and enable some button . I appreciate your help and thanku...
2
by: teddybyte | last post by:
my script below is: #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, ...
2
by: arun1985 | last post by:
In the project i am using i am having the following code and when i upload it to the server.Its givig me the following error in the global.cs file. Server Error in '/' Application. ...
6
by: JR | last post by:
The code below compiles and runs perfectly in Windows XP Pro, Using MS VS 2005. If I compile with g++ (cygwin) using the following command line: g++ -pedantic -Weffc++ -Wall -Wctor-dtor-privacy ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.