xml

XML Dom: storing key/value pairs

I am new to dealing with XML and I have to store key/value pairs. Is there a preferred way of doing this? Here are a few possibilities I could come up with: Way 1 <item key="k1" value="val1" /> <item key="k2" value="val2" /> <item key="k3" value="val3" /> Way 2 <item><key>k1</key><value>val1</value></item> <item><key>k2</key><value>...

Parsing XML in C

How to parse XML response coming from the server in C. Do we have any standard libraries for it? Can some one provide me any idea ...

JScript Print XML Document

So let me apologize right up front. I'm not a PHP programmer, I'm a C# programmer. But I have to support a website that was written for my company in PHP and is falling apart. So here's my simple question: I have the following code: xml_doc = new ActiveXObject("Microsoft.XMLDOM"); xml_doc.async = false; url = "./viewInvoiceXML.php?soh_...

how to check whether a file exists before creating it

hi I am creating an xml file. I need to check first if the file exists or not. If the file does not exist, create it and add the data cmg from a .cs file. If the file exists, don't create the file just add the data cmg from a .cs file. My code looks like this: string filename="c:\\employee.xml"; XmlTextWriter tw=new XmlTextWriter(fil...

fulltext search on xml in SQL Sever 2008

It is a simple query, how to set-up fulltext search on xml column in SQL Server 2008. ...

What is difference between XML Schema and DTD ?

Hi, I have googled this question but I do not understand clearly what is schema and DTD and why Schema is more powerful compared to DTD. Any guidance would be highly appreciated. Thanks. ...

Why is xml so prominently featured in IOC containers?

I'm trying to get into IOC containers, and I notice a large number of them are using xml configuration. Can anyone enlighten me as to why many new technologies are moving towards xml config/programming models (WCF, WPF, Spring.NET, Unity, Windsor)? It seems that xml is a poor choice for specifying complex settings and it would be better ...

Failure validating Xml: The namespace 'X' provided differs from the schema's targetNamespace 'Y'.

I'm getting the following error while validating an xml document while using IXMLDOMDocument2 (C++): The namespace 'http://www.somesite.com/schema/2.0' provided differs from the schema's targetNamespace 'http://www.somesite.com/schema/2.0/SomeObject' . The Xml I'm trying to validate is: <id:envelope xmlns:id="http://www.somesite.c...

How to read data from an XML file and store it into database (MySQL)?

I need to get data from an XML file and store it into a MySQL Database. I am thinking of using a SAX Parser for parsing the data but I am not sure of how to store data efficiently into database, I am thinking of few technologies like JDBC and Hibernate but I wanted to ask about what would be the efficient way of doing it? Note: Here pro...

How do I deserialize XML namespaces in C# (System.Xml.Serialization)?

Hi, I am just putting the finishing touches to my Zthes format deserializer (System.Xml.Serialization) which uses the namespace "dc" in the element "thes". All "term" elements are deserializing fine because they have no namespace but I cannot figure out how to tell the deserializer that the "thes" elements have a namespace. Here is wha...

Problem validating in SSIS XML Task

I have an XML file that I'm trying to validate against an XSD file in an SSIS XML Task. The XSD does do a handful of imports and includes to other files and utilizes multiple namespaces. I have opened these all in VS2005 and verified that no errors occur when validating the file there. However, when I execute my SSIS package, it does ...

XML POST REST Request using Python

Does anyone have a simple example of sending an XML POST request to a RESTful API with Python? I am trying to use the urllib2 Python library to "create a new project" in the Harvest API, with no luck. The payload variable is a valid XML document that is a near copy/paste of their documentation (under the Create New Project heading) sho...

CURL fails to send post data over 1024 bytes via command line

I am trying to post a large XML file to a web address by using curl in a shell script. I am posting the data using the '-F' option in curl. Whenever I post a file larger than 1024 bytes, the file gets cut off and only sends the first 1024. I've tried changing the "Expect:" header as suggested in another solution for PHP Curl, but it d...

XML Schema: Constraining Number of Occurrences to be Consistent

Say that element B is a child of element A. Is there a way to make sure that for each A, the number of B elements is unbounded as long as it is consistent across A elements? For example, the following would validate: <A> <B/> <B/> </A> <A> <B/> <B/> </A> Because both the first and last ...

Python: Escaping strings for use in XML

I'm using Python's xml.dom.minidom to create an XML document. (Logical structure -> XML string, not the other way around.) How do I make it escape the strings I provide so they won't be able to mess up the XML? ...

Best XML DB for a PHP website?

Hello, I'm planning on writing a RSS Feed Aggregator with a team, but I'm wondering what XML Database we should use. The server currently runs IIS 6.0 with PHP 5.3.0 x64, I understand already that I need both a server application and a PHP extension. What I've discovered already: Galax Have previously used this at university, but I ...

Attributes of XML node using Javascript

Is there a way to get the name of an attribute of an XML node using javascript. Lets take this as a sample XML <?xml version="1.0" encoding="UTF-8"?> <Employees> <Count name="EmployeeCount">100</Count> <employee id="9999" >Harish</employee> <Salary> <year id="2000">50 Grands</year> <year id="2001">75 Grands<...

How to validate XML using SAX?

How do the SAX API-s validate XML against a schema/DTD? My understanding is the SAX API-s read an XML doc chuck by chunk and do not store the previously read chunks in memory. So I'm not clear how the API could validate the doc without keeping it all in memory. ?? ...

XML Schema - Key in sequence

I'm trying to put a key in sequence and am being bombarded with errors. It seems I can't do this. Additionally, I am being told my key needs a field and selector, which I have been able to find very little documentation on. (In fact, in desperation, I downloaded Liquid XML Studio [vs. Notepad] and searched it's help files. . . to find NO...

Is there a way to output the name of elements and attributes from an XML doc?

What I am trying to do is use XSL to output all unique element and attribute names. Not their values, but their names. So given an XML of: <item id="12"> <price>12.00</price> <author>Name</author> <desc>Description</desc> </item> I want to show that there are elements of item,price,author,desc. In addition to that I want to k...