xml

WCF Can't Return XmlElement from XmlDataDocument.DocumentElement

Hi guys, I'm building a WCF web service which returns a composite object that looks similar to the following: [DataContract] public class WebServiceReturn { ... [DataMember] public XmlElement Results { get; set; } ... } When I return a WebServiceReturn object with the following code, e...

easiest way to parse xml in python

I have many rows in a database that contain xml and I'm trying to write a python script that will go through those rows and count how many instances of a particular node attribute show up. for instance, my tree looks like: <foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> I'm looking for the easiest way...

Filtering xsl:value-of on attributes

Hi, I currently have an XML document like this: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="./transform.xsl"?> <Documentation><Tables> <TABLE TABLE_NAME="FirstTable"> <COLUMN COLUMN_NAME="FirstColumn" ORDINAL_POSITION="1" IS_NULLABLE="NO" DATA_TYPE="int" /> <COLUMN COLUMN_NAME="SecondColumn" O...

Flattening a deeply nested structure in XSLT

Hi! I'm trying to learn XSLT (for some holiday coding fun). I think I now have a pretty good understanding of the basics (grabbing subtrees, filtering-out elements, and renaming elements). Where I'm having trouble is when it comes to drastically reorganizing XML structures. If you had a deeply nested structure and wanted to flatten it, h...

How can you force the browser to download an xml file?

Hi, This is my problem. I load xml from my database and push it to the client using code. But the problem is that the browser automatically opens that xml instead of offering it as a download. Is there a way to force your browser to download that file and not showing it? I'm working in a C#, Asp.net environment (with IIS7). Thx ...

BlackBerry - Modify innnet text of node in xml file

Hello, I am working on blackberry java development. I am having a xml file: <?xml version="1.0" encoding="UTF-8"?> <settings> <url>www.test.com</url> <username>testuser</username> <password>sun123ARC</password> <width>350</width> <height>350</height> </settings> I want to change the inner text of all nodes. After ...

How to edit 'binary' xml file?

It's not really a programming question but I want to edit some of the 'binary' xml files on windows.So could someone suggest me a standalone viewer/editor for 'binary' xml file? Thanks. EDIT Binary xml ...

Getting list of all properties of a node using libxml

Hi, I'm having trouble to find a way to extract a list of all properties of a node without knowing what they're called. I'm extracting single known properties using: xmlGetProp(cur, (const xmlChar*)"nodename") But how to get a list of all properties using libxml2? Regards, marius ...

Huge XML file: Do I read a "page" and process it each time?

I need to process a huge XML file, 4G. I used dom4j SAX, but wrote my own DefaultElementHandler. Code framework as below: SAXParserFactory sf = SAXParserFactory.newInstance(); SAXParser sax = sf.newSAXParser(); sax.parse("english.xml", new DefaultElementHandler("page"){ public void processElement(Element element) { // process ...

C# Conversion of CSV to XML using LINQ

The task is to convert the CSV file into XML. var x = from line in File.ReadAllLines(@"d:\sample.txt") where !line.StartsWith("#") && line.Length>0 let parts=line.Split(',') select new { XmlFile= new XElement("root", new XElement("ISBN",parts[0]), ...

xml.dom.minidom python issue

from xml.dom.minidom import * resp = "<title> This is a test! </title>" rssDoc = parseString(resp) titles = rssDoc.getElementsByTagName('title') moo = "" for t in titles: moo += t.nodeValue; Gives the following error: main.py, line 42, in get moo += t.nodeValue; TypeError: cannot concatenate 'str' and 'NoneType' object...

XML Mapping - XSLT or Code?

I have had a number of discussions recently over whether to use XSLT or code to write mapping functionality from one XML format to another or even when converting to something other than XML. Now I am of the mindset that XSLT's purpose is exactly for this type of thing and would be the most suitable option. However, other people are su...

asp.net MVC: Making an Xdocument available to jquery?

Hi there, Can anyone help, I have got an Xdocument which opens an XML files on the disk and returns it to the view in asp.net mvc... Everything is working ok. The problem being is that i need to manipulate the data with jquery, how do i pass this data which is asp.net mvc to jquery? here is what i have XDocument xdoc = XDocument.Lo...

xml error in webaplication publishing and running

hi friends, i have developed a asp.net web application in visual studio 2008. its running perfectly when i build it in visual studio. but when i published it and configured in iis and try to browse that its geeting an xml error i tried to browse this http://localhost/myproject/Pop3Client.aspx eror is like this XML Parsing Error: n...

What is equvalent code for following c# code

if (node.Attributes != null) //checking for attributes of a xml file node. ...

How to convert ods file to xml file?

I took a open office document file data in dataset using xml concept. My ods file has 11 columns,Ist row as column name after that are data of corresponding column names.If second two columns has same data means,won't read that column,skip that column values. I need a solution for getting ods file data in dataset with out missing rep...

Actionscript converts xml content to htmlentities

Actionscript 2.0. I use this code to load some data. The data is some text with html tags within a CDATA section, and some other stuff. var xml_data:XML = new XML(); xml_data.ignoreWhite = true; xml_data.onLoad = function(success) { trace(this); }; xml_data.load("http://test/data.xml"); Why are all my html tags (and other special...

XSL transformation and special XML entities escaping

Hi, I have an XML file which is transformed with XSL. Some elements have to be changed, some have to be left as is - specifically, text with entities &quot;, &amp;, &apos;, &lt;, &gt; should be left as is, and in my case &quot; and &apos; are changed to " and ' accordingly. Test XML: <?xml version="1.0" encoding="UTF-8" ?> <root> <...

Tool to find out XPath

I find XPath difficult to get my head around at times and am looking for a tools that I can point at a line in an xml config file an it will tell me the xpath to the attributes that I need. Any help with this would be much appreciated> ...

Use two schemas in one xml

Hi! I have the following xsd files: SchemaA <?xml version="1.0" encoding="utf-8"?> <xs:schema targetNamespace="http://schemaA" elementFormDefault="qualified" xmlns="http://schemaA" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; <xs:element name="Configuration"> <xs:complexType> <xs:all> ...