473,789 Members | 3,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Namespace question

Hi,

I've got a question on namespaces. After reading
http://www.w3.org/TR/xml-names11 I still don't understand how namespaces are
applied to attributes - particularly in regard to how processing
applications are supposed to determine the proper validation DTD.

In the following XML:
-------------
<?xml version="1.0" ?>
<root xmlns="http://www.w3.org/TR/REC-html40"
xmlns:html="htt p://www.w3.org/TR/REC-html40">
<a href="page1.htm l" html:href="page 2.html">
<html:a href="page1.htm l" html:href="page 2.html">
</root>
-------------

How is an application supposed to interpret these attributes?

TIA,
Axel Dahmen
Oct 11 '06
13 2528
I see, from all responses I now see that dealing with DTD on XML seems to be a waste of time then. So I'll forward to Schema now.

The XML specification is older than XML Schema. So is it safe then to assume that an XML document having no DTD but a reference to XML Schema is still declared to be valid (provided the XML data is valid)?

Thanks to all of you for your valuable help.

Regards,
Axel Dahmen

Oct 14 '06 #11
Axel Dahmen wrote:
I see, from all responses I now see that dealing with DTD on XML seems to be a waste of time then.
There are folks who will argue about this, but that's essentially the
conclusion I've reached. DTDs were inherited from SGML, back when XML
was new and XML was mostly being processed through tools also inherited
from SGML. While it *might* have been possible to extend DTDs to deal
with namespaces, it would have been somewhat ugly and the namespace
committee fairly explicitly decided that it was better to leave them
behind.

If we had it all to do over again, it might have been better to have
defined the XML Infoset first -- including namespaces and some of the
other features -- and then derived schemas and the XML syntax and the
other tools and APIs from that basis. But doing it in this order, while
it has resulted in some confusion, allowed XML to get out into the real
world and establish itself a lot faster, so I can't really argue that it
was the wrong decision.
So is it safe then to assume that an XML document having no DTD but a
reference to XML Schema is still declared to be valid (provided the
XML data is valid)?
Due to the order in which things were defined, there are actually two
separate definitions of validity -- validity against the DTD (if any)
and validity against the schema (if any). Schema wasn't allowed to alter
the basic XML specification, so it wasn't allowed to change or enhance
the old meaning of validity; it had to add a secondary one. (There are
also some subtleties in exactly where additional information from the
schema winds up in the XML Infoset that also come from this decision
that schemas add information rather than changing information, which you
may be able to ignore for a while.)

So: There is Validity, and there is Schema Validity. Normally you're
only worried about one, and tools may mask this distinction by reporting
invalid if either stage fails.

I know, more detail than you wanted. And if you're lucky, more
information than you'll need for a while. But you asked.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Oct 14 '06 #12
I should add that, colloquially, "invalid" these days is often used to
mean "not valid against whichever schema language we're checking this
kind of document against."

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Oct 14 '06 #13
I know, more detail than you wanted. And if you're lucky, more
information than you'll need for a while. But you asked.
No no, not at all!! You've been a great, great exhaustive source for me to finally understand namespaces and DTDs (along with Johannes, of course!). Your comments have laid out a good path for me to further dig into XML and finally write my own applications consuming XML.

The Namespace and XML specifications don't yield this kind of information, even XML 1.1 doesn't decouple from DTDs.

So, finally, from what you've wrote, an application is going to examine an element's attributes and interpreting them in a way whichever it thinks is appropriate, right? I assume namespaces in attributes are only used to introduce foreign attributes with probably predefined external meaning then.

Best wishes,
www.dashop.de
Axel Dahmen

Oct 18 '06 #14

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

Similar topics

1
2725
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 namespace prefix, what is its namespace, if default namespaces do not apply? Are (either of) prefixed or non-prefixed attributes correct? For example, are the following equivalent: <html:br class="foo"...
25
3097
by: kj | last post by:
Consider the following XML document: <?xml version='1.0' encoding='UTF-8'?> <bar:foo xmlns:bar='someuri'> <baz/> </bar:foo> What namespace does baz belong to? What is this namespace bound to/associated with? My understanding was that baz above belongs to some "default default namespace", but I have not been able to
3
10043
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" xmlns:ns1="abc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" media-type="text/xml" standalone="yes" version="1.0"/> <xsl:template match="/">
6
555
by: clinton__bill | last post by:
Hi, I usually use "using namespace <namespace_name>" to reference a namespace. Today I run across a code, in its header file it has this, namespace SP1{ class C1; } While SP1::C1 is a namespace::class declared and defined somewhere else. It seems the above 3 lines is similar to "using namespace SP1;",
2
7515
by: Tony Johansson | last post by:
Hello! I'm reading a book about C++ and there is something that I don't understand so I ask you. Below I have the text from the book and the code from the file where main is located and some namespace definition with class definitions. The book says "C++ has a global anonymous namespace that is similar to Java's global anonymous package. All declarations not explicitly placed in named
20
3872
by: Patrick Guio | last post by:
Dear all, I have some problem with insertion operator together with namespace. I have a header file foo.h containing declaration of classes, typedefs and insertion operators for the typedefs in a named namespace namespace foo { class Foo
4
4395
by: Programatix | last post by:
Hi, Normally, I would use Namespace for all the window forms I created. With VS 2005, the code generated by the designer is hidden using partial keyword. The question is, is there an efficient way to add any window forms created into a namespace? Currently, I enclose the class for .vb and .designer.vb inside a namespace manually.
32
30508
by: toolmaster | last post by:
Since many of the modern computer languages have built-in namespace features, I can't understand why not add this feature into standard C. I've heard many people complain of the lacking of namespace in C. Of course, namespace doesn't eliminate name polution, but it helps more than just to put some prefix before a function name. Is it because adding namespace will make C more complex or some other reasons?
3
2288
by: CrazyJohn | last post by:
Hi guys, This is my first time posting question here, if I break any rules, please kindly point out. And I'm really glad to be a part of this community. Here is my question, Our lecturer told us that Unnamed Namespace is an alternative to Static Internal Variables, but he also said that Namespace has an
17
30685
by: Peng Yu | last post by:
Hi, I'm wondering if there is something in namespace like the 'private' keyword in class? I want to define some class or function that can only be used within that namespace. Thanks, Peng
0
9665
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
10199
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...
0
9020
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7529
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5417
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...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4092
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
2
3697
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
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.