xmlns

How to remove xmlns attribute with .NET XML API

XmlElement.Attributes.Remove* methods are working fine for arbitrary attributes resulting in the removed attributes being removed from XmlDocument.OuterXml property. Xmlns attribute however is different. Here is an example: XmlDocument doc = new XmlDocument(); doc.InnerXml = @"<Element1 attr1=""value1"" xmlns=""http://mynamespace.com/""...

What are XML namespaces for?

This is something that I always find a bit hard to explain to others: Why do XML namespaces exist? When should we use them and when should we not? What are the common pitfalls when working with namespaces in XML? Also, how do they relate to XML schemas? Should XSD schemas always be associated with a namespace? ...

How to prevent blank xmlns attributes in output from .NET's XmlDocument?

When generating XML from XmlDocument in .NET, a blank xmlns attribute appears the first time an element without an associated namespace is inserted; how can this be prevented? Example: XmlDocument xml = new XmlDocument(); xml.AppendChild(xml.CreateElement("root", "whatever:name-space-1.0")); xml.DocumentElement.AppendChild(xml.Crea...

Where can I find the Dojo XMLNS DTD?

I want to add some Dojo widgets to my XHTML pages, but Dojo uses some attributes that aren't part of the XHTML spec. For example: <input dojoType="ComboBox" type="text" dataUrl="/some_data.json" /> The dojoType and dataUrl attributes cause validation problems. I believe Dojo lets me move dojoType into the class attribute: <input cl...

Modifying an xslt to be namespace agnostic

I have a XSLT I've created to handle a particular xml document. However, now namespaces are being introduced in some, but not all of our documents. I'd like to use the same XSLT for these documents, however I'm having trouble modifying my stylesheet to be namespace agnostic. It's been suggested previously to modify my xpaths to *[local...

How can one find unknown XML namespaces in a document?

Specifically (taking a deep breath): How would you go about finding all the XML name spaces within a C#/.NET XmlDocument for which there are no applicable schemas in the instance's XmlSchemaSet (Schemas property)? My XPath magic is lacking the sophistication to do something like this, but I will keep looking in the meantime ... ...

XML Namesapce in WPF - xmlns

The following XML namespaces references are included in at the top of every new Xaml file. //http://schemas.microsoft.com/winfx/xaml/presentation //http://schemas.microsoft.com/winfx/xaml The winfx/xaml/presentation holds references to a bunch of windows namesapces such as Windows.Navigation, Windows.Controls ect. The winfx/xaml names...

Facebook Connect Won't Validate

I'm trying to get my Facebook Connect code to validate, but it won't. I think the problem is that their xmlns page isn't loading. I have the code: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en"> But http://www.facebook.com/2008/fbml isn't found. Does anyone have a cop...

Is there a way to map a tag in flex to components in multiple directories?

Given a flex application or module, you can specify a custom xml namespace as follows: <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:custom="custom.namespace.*"> We can then refer to mxml components in the directory custom/namespace/ using the custom tag. For example, if I have the components Custom1 and Custom2 in the c...

Inserting an element into xml produces an unnecessary propertry xmlns=

Whenever I insert an element into my xml document, the system adds an xmlns="" attribute to it. How do i get rid of it? Why is it there? Im using very simple linqtoxml. I've got a simple XML file (Note there is no Xml declaration line and it contains a namespace): <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/deve...

Blank xmlns="" Attributes From Import

Hi all, I'm attempting to do a transform on an XML document. My XML transform can result in two different types of base element depending on the value of a certain element: <xsl:template match="/"> <xsl:choose> <xsl:when test="/databean/data[@id='pkhfeed']/value/text()='200'"> <xsl:call-template name="StructureA"> ...

Delphi - Invalid namespace URI in IXMLNode

I am trying to parse a response from a SOAP web service, but part of the data has an invalid xmlns element and I think it is causing me no end of trouble. The part of the XML that I am working with is as follows. <soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt; <ResponseData xmlns="http://www.example.com/WebSer...

Can I avoid having to use fully-qualified element names in LINQ to XML?

Say I call XElement.Parse() with the following XML string: var xml = XElement.Parse(@" <?xml version="1.0" encoding="UTF-8"?> <AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt; <Owner> <ID>7c75442509c41100b6a413b88b523bd6f46554cdbee5b6cbe27bc08cb3f6a865</ID> <DisplayName>me</DisplayName> </...

Facebook Connect and HTML5, xmlns available?

Facebook Connect and their "Social Widgets" documentation mention that you need to add an xmlns attribute to your <html> tag on the page where it will be used. I understand that xmlns is for XML Name-spacing, and have used such with XHTML before. However, with all the recent talk about HTML4 / HTML5, without having read through the ent...

XPath query for empty namespace xmlns=""

What XPath do I use to query the info node in the xml below? I've tried different expressions in XMLSpy but nothing works. <root xmlns="tempuri.org" xmlns:p="http://nonamespace.org/std/Name/2006-10-18/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; <item xmlns=""> <info>blah blah</info> <date>2009-07-27 00:00:00</date> </...

Parse and query SOAP in C#

I am trying to parse a heavily namespaced SOAP message (source can be found also here): <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; <soapenv:Header> <ns1:Transac...

Java DOM XML is skipping xmlns properties

Hi there, I need to generate an xml file in Java, so I chose to use DOM (until there everything is ok), here is the root tag of what i need to create <?xml version="1.0" encoding="utf-8"?> <KeyContainer Version="1.0" xmlns="urn:ietf:params:xml:ns:keyprov:pskc:1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xenc="http://www.w3.o...

Adding XMLNS causes VS seize up

Currently in my XAML editor view I am experiencing frequent seizing episodes of around 3 seconds each. I've been able to narrow down the reason for it to custom namespaces. By default, my page has the 2 default XMLNS declarations: <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.m...

XPath Transform messes up with xmlns

Hi, I'm making a tool to create some xml files signed, and I need to use an XPath so my sign doesn't sign itself : <ds:Transforms> <ds:Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"&gt; <ds:XPath>not(ancestor-or-self::ds:Signature)</ds:XPath> </ds:Transform> <ds:Transform Algorithm="http://www.w3....

XSLT applied to XML doc with xmlns attribute

I'm applying an XSLT stylesheet to the following XML file: <top xmlns="http://www.foo.com/bar"&gt; <elementA /> <elementB /> <contents> <contentitem> <id>3</id> <moretags1 /> <moretags2 /> </contentitem> <contentitem> <id>2</id> ...