Questions tagged [xml-namespaces]

According to the standard, "XML namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references."

According to the standard,

XML namespaces provide a simple method for qualifying element and attribute names used in Extensible Markup Language documents by associating them with namespaces identified by URI references.

Please note that, although many XML namespaces take the form of a URL, they do not necessarily refer to a location on the Internet.

See also: What are XML Namespaces for?

2420 questions
38
votes
4 answers

How do I use xml namespaces with find/findall in lxml?

I'm trying to parse content in an OpenOffice ODS spreadsheet. The ods format is essentially just a zipfile with a number of documents. The content of the spreadsheet is stored in 'content.xml'. import zipfile from lxml import etree zf =…
saffsd
  • 23,742
  • 18
  • 63
  • 67
37
votes
5 answers

How to turn on the 'throwIfNamespace' flag in React.js

I have some code like below in my component.
abu abu
  • 6,599
  • 19
  • 74
  • 131
37
votes
1 answer

XML Namespace URI with HTTPS?

Is it better to have a xmlns URI with https protocol? For example this is the recommended way by the manual: Is it legal and better to use this way?
kavai77
  • 6,282
  • 7
  • 33
  • 48
36
votes
6 answers

How do I use XPath with a default namespace with no prefix?

What is the XPath (in C# API to XDocument.XPathSelectElements(xpath, nsman) if it matters) to query all MyNodes from this document?
Scott Stafford
  • 43,764
  • 28
  • 129
  • 177
34
votes
2 answers

HTML: What is `xmlns:fb="http://www.facebook.com/2008/fbml"`?

What is xmlns:fb="http://www.facebook.com/2008/fbml"? I've been seeing it in a lot of tags recently. What does it do?
Rudiger
  • 341
  • 1
  • 3
  • 4
32
votes
3 answers

HTML5 attributes xmlns, lang, xml:lang

I don't understand the HTML5 specifications for the lang and xml:lang attributes of the opening tag. Scrolling up a bit, I understand that xmlns is a "talisman" (has no effect), but what about lang and xml:lang? Should they be used? If so,…
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
30
votes
4 answers

XML Default namespaces for unqualified attribute names?

I'm trying to understand the correct interpretation of the "Namespaces in XML 1.0 (Third Edition)" definition for unqualified attribute namespaces. "The namespace name for an unprefixed attribute name always has no value." And later in the same…
mckamey
  • 17,359
  • 16
  • 83
  • 116
30
votes
1 answer

xmln:tns and targetNamespace

I am seeing some XSD schema documents that declare both a targetNamespace and an xmlns:tns attribute in their top schema element. E.g. the following one taken from here. They also seem to have the same string value. I understand the role of…
Marcus Junius Brutus
  • 26,087
  • 41
  • 189
  • 331
28
votes
2 answers

xaml what is "local:"?

What is local: in XAML, and what parameters in a C# class can be called local: ? In some code I am looking at, I see xmlns:local="clr-namespace:AskLocal". What does this mean?
yozawiratama
  • 4,209
  • 12
  • 58
  • 106
28
votes
2 answers

Is xmlns="" a valid xml namespace?

Is "empty" a valid value for XML namespace? If yes what does it mean? I have the following XML code but I'm not sure to which namespace Field1 and Field2 elements belong to.
Sergej Andrejev
  • 9,091
  • 11
  • 71
  • 108
27
votes
1 answer

How do I specify XML serialization attributes to support namespace prefixes during deserialization in .NET?

I have a following XML: John Wayne 37 How do I define XML serialization attributes on a class to support…
Piotr Owsiak
  • 6,081
  • 8
  • 39
  • 42
26
votes
3 answers

How to remove namespaces from XML using XSLT

I have a 150 MB (it can go even more sometimes) XML file. I need to remove all the namespaces. It's on Visual Basic 6.0, so I'm using DOM to load the XML. Loading is okay, I was skeptical at first, but somehow that part works fine. I am trying the…
coder
  • 4,121
  • 14
  • 53
  • 88
25
votes
2 answers

How to remove xmlns attribute of a node other than root in an XDocument?

Situation I'm using XDocument to try and remove an xmlns="" attribute on the first inner node: So what I want as a result…
MarioDS
  • 12,895
  • 15
  • 65
  • 121
24
votes
2 answers

Adding namespaces to root element of xml using jaxb

I am creating an xml file whose root elemenet structure shuould be like: i created…
Aquarius24
  • 1,806
  • 6
  • 33
  • 61
23
votes
2 answers

XSD with elements from other namespace

I have two XSDs that are definining different documents. Say A.xsd defines an element ElementA as the root, with some complex rules. Now B.xsd defines an element ElementB that is supposed to use ElementA somewhere in between. For example I want the…
poke
  • 369,085
  • 72
  • 557
  • 602