xml-namespaces

extracting RDL data using LINQ

I'm working with some SQL Report definition files (RDLs), using LINQ to extract component query statements for validation. I'm trying to extract the <DataSet> elements from under the <DataSets> element. I seem to be getting hung up with one of the elements under <DataSet><Fields><Field> which has a namespace qualifier <rd:TypeName> I've...

XSLT: change namespace in transformer, not in in stylesheet / remove namespace prefix

I am transforming some XML using XSLT and Saxon like this: Source sourceXML = new StreamSource(...); Source sourceXSLT = new StreamSource(...); System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl"); TransformerFactory transFact = TransformerFactory.newInstance(); Templa...

Python xpath not working?

Okay, this is starting to drive me a little bit nuts. I've tried several xml/xpath libraries for Python, and can't figure out a simple way to get a stinkin' "title" element. The latest attempt looks like this (using Amara): def view(req, url): req.content_type = 'text/plain' doc = amara.parse(urlopen(url)) for node in doc.x...

SQL Server XML Declare Namespace

Hi All, I would like to have a few namespaces available by default when running an XQuery in SQL Server 2005, is this possible? For example, I would like to do the following: select * from TableWithXML where FieldWithXML.exist( declare namespace nsp="http://www.example.com/exampleNamespace"; nsp:root/nsp:childnode) = 1 Without having...

Changing a namespace value in an XSL transformation?

I'm not sure if that is possible, as I'm very new to XSLT and stuff, but maybe some of you could help me here? It's a bit tricky and I haven't found anything like it on the internet: The problem is that I have an input xml with namespaces declared and all and I only need to make slight changes to it (adding or deleting attributes, or sh...

JAXB appending unneeded namespace declarations to tags

I'm implementing a homebrew subprotocol of XMPP, and i'm using combination of StAX and JAXB for parsing/marshalling mesages. And when I marshall a message I end up with loads of unneded namespace declarations: <ns2:auth xmlns:ns2="urn:ietf:params:xml:ns:ilf-auth" xmlns:ns4="ilf:iq:experiment:power" xmlns:ns3="ilf:iq:experiment:i...

How do I add a namespace attribute to an element in JAXB when marshalling?

I'm working with eBay's LMS (Large Merchant Services) and kept running into the error: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. After alot of trial and error I traced the problem down. It turns out this works: <?xml version="...

xml and namespace anomaly

What is the difference between the following pieces of xml? The reason I ask is that when I submit the xml to a BPEL process the first and second one work but the last one does not, what is going on? <!-- imported namespace referenced with prefix --> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http:...

RESTFUL WCF Remove all xmlns

I set my DataContracts namespace to "" which removed one namespace but I have to remove the other: xmlns:i="http://www.w3.org/2001/XMLSchema-instance" If theres no other way, how can I serialize my class prior to returning and hack out the namespace? I have to do this to work with another companys API. ...

Why do I have to pass an empty namespace to XPathNavigator.GetAttribute?

Given the following XML markup: <root xmlns="Demo"> <child name="foo"/> </root> and an XPathNavigator positioned on the <child> element, string withNs = navigator.GetAttribute("name", navigator.NamespaceURI); string withoutNs = navigator.GetAttribute("name", ""); produce strange results: withNs is empty, withoutNs contains foo....

Can find descendants using LINQ to XML or XPath Extensions

Anyone knows the problem why linq to xml or xpath extensions cant seem to read this xml? http://www.quillarts.com/Test/product.xml var document = XDocument.Load(feedUrl); var xpathxml = from feed in document.XPathSelectElements("//Products") //using Xpath var linqtoxml = from feed in document.Descendants("Products") //using Linq2XML ...

Document type declaration and namespaces

Hi I’m new to XML and am currently learning about Document Type Declaration. Anyways, when declaring elements in the body of DTD, the element name must appear exactly as it will within the XML document, including any namespace prefix, which means users can’t define their own namespace, but must use the prefix defined within DTD. a) I...

PHP namespace simplexml problems

Evening guys. Firstly to say, I have read http://stackoverflow.com/questions/1133897/how-do-i-parse-xml-containing-custom-namespaces-using-simplexml. I'm parsing an XML document from a source not mind, and they use a custom namespace. <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:moshtix="http://www.moshtix.com.au"&g...

What is this XSD import namespace for?

I have an xsd document that starts with: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/&gt; <xs:complexType name="T_segment"> <xs:sequence> <xs:el...

php xslt transformation always adds xmlns=""

Guess the title says it al, somehow my xslt transformation with php always adds xmlns="" as an attribute to all root elements. Is there a way to prevent this? ...

Using Linq to XML to write NAnt .build files

I'm trying to create an XML file using C# and Linq to XML, but am having problems with the nant namespace. var myXElement = new XElement("project", new XAttribute("name", "MySystemName"), new XAttribute("default", "myNAntTargetName"), new XAttribute("xmlns", "http://nant.sf.net/schemas/nant.xsd")); myXElement.Save("c:\foo.xml"); Beca...

Why can't my JAXB Unmarshaller find an element declared in an imported schema?

I have two schemas A and B with a circular dependency (it's an intermediate step). The XML files I'm using as input validate against the schema according to xmllint and Visual Studio. Eclipse is telling me that both schemas contain two global components with the same name. A.xsd: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"...

How to do namespace aware DOM traversal in IE6..IE8 xml documents?

I am implementing a javascript library that talks to a SOAP webservice. I use the XMLHttpRequest to do requests and receive responses. The SOAP responses rely heavily on multiple namespaces. For all major browsers, except all versions of Internet Explorer, I can use getElementsByTagNameNS() and getAttributeNS() to traverse and parse th...

Remove namespace from WebService

Hi, everybody! I have a .Net web services that are called from flex. Our programmer receives the following xml when calling web service function: <FunctionName xmlns="WSNamespace" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSc...

XPath Expression returns nothing for //element, but //* returns a count.

I'm using XOM with the following sample data: Element root = cleanDoc.getRootElement(); //find all the bold elements, as those mark institution and clinic. Nodes nodes = root.query("//*"); <html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"&gt; <head> <title>Patient Information</title> <...