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

what does xmlns do exactly?

i've looked XMLNS definition. and still have a question.

what if i define two defferent 'xmlns' for a namespace?

ex)

<nsa:aelement xmlns:nsa="a">
<nsa:aelement xmlns:nsa="b">
</nsa:aelement>
</nsa:aelement>

is it possible? and those two elements work as totaly different
elements?

Dec 14 '06 #1
10 16450
what if i define two defferent 'xmlns' for a namespace?
<nsa:aelement xmlns:nsa="a">
<nsa:aelement xmlns:nsa="b">
</nsa:aelement>
</nsa:aelement>
Namespace prefix bindings are scoped. The descendants of the outer
element which reference the nsa: prefix understand it to mean the
namespace "a", EXCEPT where that's overridden by another definition as
you've done here. In this example the inner element and all its
descendants understand nsa: to mean the namespace "b".

Remember, the prefix is just a syntactic shorthand. What really carries
meaning is the combination of the URI the prefix is bound to plus the
localname following the prefix.

WARNING: These are NOT good namespace names. Namespace names should be
absolute URI references, according to the W3C. If you're going to use
something short and sloppy, in an example, you should at least use
"http://a" or something of that sort. (There was a major debate about
this in the W3C, due to a combination of sloppy wording in the first
draft of the namespace spec and some fuzzy thinking about whether there
was any useful way to interpret relative namespaces. The decision was
made to deprecate relative namespace URIs until and unless someone
convinces the W3C that they are both necessary and practical.)

>
is it possible? and those two elements work as totaly different
elements?

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Dec 14 '06 #2
By the way, the "Namespaces in XML" specification, available from the
W3C's website, does spell out how namespace scoping works.
Dec 14 '06 #3
In article <45819442$1@kcnews01>,
Joseph Kesselman <ke************@comcast.netwrote:
>The decision was
made to deprecate relative namespace URIs until and unless someone
convinces the W3C that they are both necessary and practical.
Should relative namespace URIs be interpreted relative to xml:base?

(That's a rhetorical question, just in case there was any doubt.)

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Dec 14 '06 #4
Richard Tobin wrote:
Should relative namespace URIs be interpreted relative to xml:base?
1) They shouldn't be used, period. The W3C has deprecated them. There
are absolutely NO promises about what will happen if you insist on
pointing this gun at your foot and pulling the trigger.

2) Namespace URIs are usually not interpreted in any case. A namespace
name is just that, a *NAME*, expressed in URI form mostly because we
already knew how to manage the value space of URIs so people didn't
accidentally use each others' values. There is absolutely NO promise
about whether a resource is actually available at that location or what
it might be if so. (The W3C's Semantic Web working group has been trying
to reach some sort of consensus on this, but as far as I know they still
haven't announced any conclusions.)

3) "Mu."

>
(That's a rhetorical question, just in case there was any doubt.)

-- Richard

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Dec 14 '06 #5
In article <4581a292@kcnews01>,
Joseph Kesselman <ke************@comcast.netwrote:
>Should relative namespace URIs be interpreted relative to xml:base?
>1) They shouldn't be used, period. The W3C has deprecated them.
My rhetorical question was meant to suggest a reason for them to
continue to...
>2) Namespace URIs are usually not interpreted in any case.
They're not dereferenced, certainly.
>A namespace
name is just that, a *NAME*, expressed in URI form
Right, but would that name be combined with the current base URI?
Would this be the root element of an XSLT stylesheet?

<stylesheet xmlns="XSL/Transform" xml:base="http://www.w3.org/1999"
version="1.0">

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Dec 14 '06 #6
Richard Tobin wrote:
>>>Should relative namespace URIs be interpreted relative to xml:base?
1) They shouldn't be used, period. The W3C has deprecated them.
My rhetorical question was meant to suggest a reason for them to
continue to...
Good enough. I'm still surprised how many people DID try to argue that
the meaning of <thisCouldKillYou:safetyPolicyshould change when they
moved the document from one directory to another
>>2) Namespace URIs are usually not interpreted in any case.
They're not dereferenced, certainly.
Better phrasing; thanks for the correction.
Right, but would that name be combined with the current base URI?
Would this be the root element of an XSLT stylesheet?
<stylesheet xmlns="XSL/Transform" xml:base="http://www.w3.org/1999"
version="1.0">
No. Namespace names are just literal strings whose syntax is required to
be that of absolute URI references. Absolutely no URI handling magic is
applied to them.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Dec 14 '06 #7
In article <4581d1a3$1@kcnews01>,
Joseph Kesselman <ke************@comcast.netwrote:
>Right, but would that name be combined with the current base URI?
Would this be the root element of an XSLT stylesheet?
<stylesheet xmlns="XSL/Transform" xml:base="http://www.w3.org/1999"
version="1.0">
>No. Namespace names are just literal strings whose syntax is required to
be that of absolute URI references. Absolutely no URI handling magic is
applied to them.
They *are*, but I was considering the hypothetical case. Combining
namepace names with base URIs is what at least one company who argued
for relative namespace URIs wanted. In particular, they wanted
relative namespace URIs in different documents to be distinct by
virture of being relative to different URIs.

This was one of the few case where the W3C held a ballot to resolve
the issue; as we all now know the result was to deprecate relative
namespace URIs and declare that future specs would "define no
interpretation".

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Dec 14 '06 #8
Richard Tobin wrote:
This was one of the few case where the W3C held a ballot to resolve
the issue
And I think consensus, now that we've all had time to think about it is
that the majority decision was, in fact, the right decision. (Remember,
I was there too. One of the few times I've found myself in a
head-to-head with Tim B-L.)

Bringing up a hypothesis which has already been considered and
discredited without clarifying that status strikes me as more confusing
than helpful. XML Namespaces "is what it is and that's all what it is";
let's not distract folks with excursions into why the alternatives are
broken unless they're specifically interested in that history. If pigs
had wings, they'd be pigeons.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Dec 14 '06 #9
In article <4581e3b0$1@kcnews01>,
Joseph Kesselman <ke************@comcast.netwrote:
>Bringing up a hypothesis which has already been considered and
discredited without clarifying that status strikes me as more confusing
than helpful.
I was just giving an illustration of why it was unlikely that the
W3C would ever consider them practical, in response to your original
comment:
>The decision was
made to deprecate relative namespace URIs until and unless someone
convinces the W3C that they are both necessary and practical.
Relative namespace URIs are just a can of worms.

I *did* say it was a rhetorical question!

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
Dec 15 '06 #10
I *did* say it was a rhetorical question!

Good enough. We can chalk it up to "agreeing at the tops of our voices",
then. <grin/>

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Dec 15 '06 #11

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

Similar topics

7
by: DKM | last post by:
I need an equivalent for the following: document.getElementById('equation').update(); from Mathplayer to use it in Mozilla based browser. When I change any text node, the page updates just...
8
by: xmail123 | last post by:
Hi, As was pointed out whatever you return from a WebMethod needs to be serializable to SOAP. An ArrayList is not serializable. I will be needing to return other data types from web methods. ...
6
by: seeIT | last post by:
In a client application a simple webservice (add/multiply) was added to solution panel but proxy methods do not appear. WSDL description in solution panel follows: <?xml version="1.0"...
7
by: ÀÏÆÅ»³ÔÐ5¸öÔ | last post by:
I want use dropdownlist contral in gridview but have trouble now mycode here: i'm very sorry for my poor english <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"...
1
by: hilz | last post by:
Hi. I have two xml files with the following roots: <MyRootElement xmlns="http://myURI" xmlns:prefixA="http://URI_for_A" xmlns:prefixB="http://URI_for_B"...
3
by: ano | last post by:
Hi, Anyone knows how to get "xmlns" value from XML file? For example, how to check that this xml file has a xmlns or not? Or how to read the xmlns value? <bookstore...
0
by: mjed01 | last post by:
hi, i am trying to implement a web service using php. it should return a complex type, but it is always null. i have the following wsdl: <?xml version="1.0" encoding="utf-8"?> ...
0
by: vpal61 | last post by:
Hello, I have an Excel/VBA web service client with SOAP Toolkit, consuming Apache Tomcat webservice, which is working fine. Now I am trying to migrate to .NET, and build client in VS2005 with...
1
by: ismailc | last post by:
Hi, I need help please. Update system to to new version & moved on to .Net2 But now my code that worked in my .Net1 xslt does not work. .Net1 fine: <xsl:stylesheet...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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.