473,657 Members | 2,507 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 1414


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
955
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") && feed.DocumentElement.NamespaceURI.Equals("http://www.w3.org/1999/02/22-rdf-s yntax-ns#"))
2
1635
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? if(feed.DocumentElement.LocalName.Equals("RDF") && feed.DocumentElement.NamespaceURI.Equals("http://www.w3.org/1999/02/22-rdf-s...
1
2522
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 xmlns="http://www.qad.com/qdoc" xmlns:enc="http://www.w3.org/2002/12/soap-encoding"...
5
1465
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
18725
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/' xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance' xmlns:xsd='http://www.w3.org/1999/XMLSchema'>
5
6953
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>, <svg:lineetc. instead of just <svgand <line>, as it is noted in the external file?
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
1479
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
3911
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 functions and variables. In C++ the static keyword can still be used, but its use is more
0
8743
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
8622
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
7355
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
6177
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
5647
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
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
1736
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.