473,772 Members | 2,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="hell o">
&hello;
</a>
====
test.ent
----
<?xml version="1.0" encoding="utf-8"?>
<!ENTITY % prefix "xxx:">
<!ENTITY hello "<%prefix;h ello/>">
====

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="hell o">
<hello/>
</a>
====

What am I missing?

Thanks. romeo

--
Romeo Disca
Email: ro*********@t-online.de
Jul 20 '05 #1
1 7309
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="hell o">
&hello;
</a>
====
test.ent
----
<?xml version="1.0" encoding="utf-8"?>
<!ENTITY % prefix "xxx:">
<!ENTITY hello "<%prefix;h ello/>">
====

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="hell o">
<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
9033
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' undeclared (first use this function)
2
2222
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
2858
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 the errors the compiler generates: ex1.cpp: In function `int main()': ex1.cpp:12: error: `testing' is not a class or namespace ex1.cpp:12: error: `pubtest' undeclared (first use this function) ex1.cpp:12: error: (Each undeclared identifier is...
5
10012
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 C# app for viewing purposes. I am using "XmlDocument" and "DataSet" for displaying the XML data in the Data grid. Problem: If I add the Namespace declaration to the data file itself (by manually opening the file and adding a new Root element...
4
2721
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); I get "syntax error: identifier" and "undeclared identifier". Since they're in the same namespace, and even in the same project, do I need
4
4150
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 in advance When I run the pgm , I get the error: Can't parse login information. Namespace Manager or XsltContext needed. This query has a prefix, variable or userdefined function. I have added the Try-catch in all my functions. In...
2
3384
by: teddybyte | last post by:
my script below is: #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
2
2338
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. -------------------------------------------------------------------------------- Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack...
6
3634
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 -Wold-style-cast - Woverloaded-virtual -o kk kk.cpp it displays the following errors: kk.cpp: In function `void Burp(std::ostream&, std::vector<std::vector<T, std::allocator<_CharT, std::allocator<std::vector<T, std::allocator<_CharT &)':
0
9620
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.