473,570 Members | 2,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Default-default namespace and localname

Max
Hello everyone!

I have 2 questions:
- Is the default-default namespace "http://www.w3.org/2000/xmlns/" or an
empty string("")?
- Is the localname property for element without prefix the name of element
(localName = nodeName) or an empty string("")?

Thanks,

Max
Aug 1 '06 #1
2 1411


Max wrote:

- Is the default-default namespace "http://www.w3.org/2000/xmlns/" or an
empty string("")?
The namespace with namespace URI http://www.w3.org/2000/xmlns/ is
predefined for xmlns declarations, see
<http://www.w3.org/XML/xml-names-19990114-erratawhich says:
"The prefix xmlns is used only to declare namespace bindings and is
by definition bound to the namespace name http://www.w3.org/2000/xmlns/.
It must not be declared. No other prefix may be bound to this namespace
name."

I don't know what "default-default" namespace is supposed to be, if no
default namespace is declared using xmlns="someURI" then elements are in
no namespace if they don't have a prefix in their name.
- Is the localname property for element without prefix the name of element
(localName = nodeName) or an empty string("")?
Well it depends on the object model/standard/implementation but for the
W3C DOM Level 2 Core in a namespace aware implementation the localName
then is the same as the nodeName.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 1 '06 #2
Max wrote:
- Is the default-default namespace "http://www.w3.org/2000/xmlns/" or an
empty string("")?
If you do not define a default namespace (or if you undefine the default
namespace by assigning "" to it), the default is "no namespace". (Empty
string is not a legal namespace URI, it's just how XML expresses "no
namespace"). Whether that shows up as empty string or null or something
else depends on which API you're using to access the document's contents.
- Is the localname property for element without prefix the name of element
(localName = nodeName) or an empty string("")?
Per the XML Infoset, if an element is not bound to a namespace it has no
localname. Again, it's up to the API you're using to decide how to tell
you this.
Aug 1 '06 #3

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

Similar topics

0
954
by: Ayende Rahien | last post by:
I've the following code, taken from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml02172003.asp to select a node from RSS file. However, I'm always getting a null returning for the SelectSingleNode(), why? if(feed.DocumentElement.LocalName.Equals("RDF") &&...
2
1634
by: Ayende Rahien | last post by:
I've the following code, taken from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml02172003.asp to select a node from RSS file. However, I'm always getting a null returning for the SelectSingleNode(), when trying to load a RSS 1.0 document, (which has a default namespace) why? ...
1
2519
by: Jack Colletta | last post by:
How can I parse the component elements per partList in the following xml file? If I remove the namespace section of the xml my code works. I am not sure why the namespace section impacts my code? Of course when I remove the namespace I section I change the selectnode reference accordingly. <?xml version="1.0"?> <workOrderReleased...
5
1464
by: Mike_August | last post by:
Could someone help me out with the following? I've got 1)an xml file 2)an xsl 3)a schema My namespaces are as follow molecular_db.xml
2
18721
by: james.cssa | last post by:
I want to declare namespace prefix in the Envelope element (i.e. xmlns:xsi and xmlns:xsd) so that the document will be serialized to look like the following. However, I don't know the right way to do that in Java. <?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'...
5
6941
by: johanneskrueger | last post by:
Hello, I'm currently using <xsl:copy-of select="document(...)/svg:svg"/to embed an SVG file into an XHTML file. I already defined the SVG namespace and assigned svg as its prefix in my XSLT 1.0 sheet. What commands instead of copy-of could I use in order to get the prefix with every element from the external file, e.g. <svg:svg>,...
2
1913
by: Philipp | last post by:
Hello, I am not able to read the namespace for my elements correctly. Could somebody point me to my error. Thank you. Philipp Compilable example: import java.io.ByteArrayInputStream; import java.io.InputStream; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document;
1
1478
by: Clive Dixon | last post by:
Given an XmlNode with namespace (NamespaceURI has a value), I want to be able to make a clone of it (XmlNode.CloneNode) but without the namespace. How can I strip the namespace from a node?
22
3897
by: Luna Moon | last post by:
I am reading the book "C++ Annotations", and here is a quote from the book: Namespaces can be defined without a name. Such a namespace is anonymous and it restricts the visibility of the defined entities to the source file in which the anonymous namespace is defined. Entities defined in the anonymous namespace are comparable to C’s static...
0
7732
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...
0
7638
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...
0
7956
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. ...
0
6336
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...
1
5523
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...
0
5247
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3671
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2136
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
1
1238
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.