xml

How to customize WCF XML serialization

We have an existing SOAP web service interface that we want to implement using WCF for a new application. This seems to work fine except for one small detail. The XML namespace of the return type of a function must be different than the XML namespace of the web service itself. And for the life of me, I can't get it to work. I've recreat...

XPathNodeIterator over an array of XPathNavigable objects?

Hello, I have an array of objects that are IXpathNavigable. I want to access the array through an xsl extention object, so I should probably do that by using an XPathNodeIterator. But how do I properly create the NodeIterator so that it iterates over the array? ...

How do I escape double quotes in attributes in an XML String in T-SQL?

Pretty simple question - I have an attribute that I would like to have double quotes in. How do I escape them? I've tried \" "" \\" And I've made the @xml variable both xml type and varchar(max) for all of them. declare @xml xml --(or varchar(max) tried both) set @xml = '<transaction><item value="hi "mom" lol" ItemId="106"...

Java XML Node Edit without Node.getTextContents()

I'm using an old version of the JRE (1.4) where Node.getTextContents() and Node.setTextContents() are not available. Is there a long way to do these actions still? Example XML: <MyEle>4119<MyEle/> Java: //myEleNode is a Node found while traversing String nodeString = myEleNode.getTextContent(); if(nodeString.equals("4119")){//do so...

HTTPWebRequest for XML containing an XSLT

I'm using the HttpWebRequest object to make a get call to a site/web service that uses XML/XSLT as its front end. When I view the source in Firefox the XML comes up, but when I make the request in my program the transformed document is returned to me. As the transformed document is very useless to me, how can I make the request and get...

Always get null when querying XML with XPath

I am using the following code to query some XML with XPath I get from a stream. DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); domFactory.setNamespaceAware(false); DocumentBuilder builder = domFactory.newDocumentBuilder(); Document doc = builder.parse(inputStream); inputStream.close(); XPathFactory factory = ...

How to deserialize an Xml Fragment using the XML Reader

I am trying to deserialize a Xml Fragment. I am nearly there but it throws an error where by it does not expect the first element. An example of the XML in the stream is as follows: <Project xmlns="http://schemas.datacontract.org/2004/07/Swissmod.Service.Model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; <ClientID>1</C...

Best method for Flex to PHP communication?

What is the best method for communication between Flex and PHP? In the past, we used AMFPHP with AS2, and it worked great for the most part (advantage of AMFPHP is that it also has a JSON mode that can let you seamlessly use the same remote PHP with either Javascript or Actionscript frontends). However, it seems like AMFPHP isn't real...

Parsing XML with CDATA with JQuery

Edit: I was missing two things here. The lack of "Content-Type:text/xml" in the header returned by the AJAX call was preventing JQuery from treating the returned data as a document. Once that was handled correctly, this code parsed correctly and output just the index and project name. $("a.getprojects").click(function(d){ d.preventD...

Decent KDE XML viewer?

what's your XML viewer of choice from within KDE? Something that formats the XML decently. I've searched around but have not found anything reasonable. ...

How to check whether a node exists in an XML file?

Hi How can I check whether a node exists in an XML file, and also count the number of nodes. I have one XML file for an example: <Employee> <Emp> <Name id="1"> A </Name> <Name id="2"> C </Name> <Name id="3"> D </Name> </Emp> </Employee> Thanks & Regards Ravikumar ...

How to Retrieve XML Node Attributes In C#

Hi how to navigate the XML file and get all a list of nodes in order to access their attributes and count no of nodes in Student tag. for example : Can anybody briefy me .how to do ? give any sample code to do so.? Thanks & Regards Ravi Kumar ...

XSD: Adding attributes to strongly-typed "simple" elements

Is there some sensible way to have elements with strongly-typed simple-types and also attributes? Okay, I have an XSD schema which has a million (er, hundred) elements that might look like this: <xsd:element name="DocumentDescription" type="xsd:string" /> <xsd:element name="DocumentDateTime" type="xsd:dateTime" /> <xsd:element name="Do...

How do I add extra information to XML generated from a dataset Writexml in C#?

ds.WriteXml(strXmlTestCasePath, XmlWriteMode.IgnoreSchema); ds is a dataset. I want to add an extra line or extra information into this XML. How do I do it? ...

convert xml to sorted dictionary

i have an xml file similar to this: <?xml version="1.0" encoding="UTF-8"?> <data> <resource key="123">foo</resource> <resource key="456">bar</resource> <resource key="789">bar</resource> </data> i want to put this into a Dictionary (sorted) as key value pairs. i.e: 123:foo, 456:bar...etc the keys are unknown. how can i...

In Haskell how do you extract strings from an XML document?

If I have an XML document like this: <root> <elem name="Greeting"> Hello </elem> <elem name="Name"> Name </elem> </root> and some Haskell type/data definitions like this: type Name = String type Value = String data LocalizedString = LS Name Value and I wanted to write a Haskell function with the following signatu...

"xmlns" Attribute Makes My XSLT Return Blank Values

Hi, I have an XML file that I am trying to transform via an XSL file. As soon as I add an non-blank xmlns attribute to the root element of my XSL, the transformation just brings me back blank data for everything. If I remove or blank out the xmlns attribute, I get back what I expect. Can anyone tell me why this is happening so I can ...

Problem with excluding namespace from XmlWriter.WriteStartElement.

Hello fellow coders, I have a little problem that perhaps you can help me with. I try to use the XmlWriter to write an XML-tag that looks like this (w3c feed recommendation): <atom:link href="http://localhost" rel="self" type="application/rss+xml" /> The problem is that I can't use the WriteStartElement-method as I would want to (at...

Flash/XML breaklines & hidden characters

I got this problem, when edit my xml everything on a next line renders two breaklines <![CDATA[Line one Line two Line three ]]> Renders in flash as Line One Line Two Line Three Now I researched this before and it had something to do with hidden breakline characters, Im using Flexbuilder and or Aptana to edit the xml, but how do ...

Free C# XML Diff library or class

Hi all. I’m looking for XML Diff class or library. There are my requirements: - open source :) - object model for output (*) - rather fast (for 4mb XML) I'm trying to use MS XML Diff and Patch Tools, but I wanna get a list of objects with differences of 2 XML files (instead HTML markup). UPD: Thanks for all of your responses. I ...