xml

How to get the Doctype Declaration in Xerces-C when using SAX2 ?

I am using SAX2 from Xerces-C to read an XML document. However, I would like to check the Doctype declaration (if there is any) to make sure that the XML file is in the format I am expecting. I have tried the unparsedEntityDecl and notationDecl methods from the DTDHandler, and EntityResolver seems to be more low-level than what I am loo...

XSL split string using empty elements

Let's say I have a line in an XML file like the following (derived from an HTML file): <i>This is a nice poem<br/>It doesn't rhyme<br/>because right now<br/>I don't have time</i> I am attempting to right an XSLT to split this string with the following output: <stanza> <line>This is a nice poem</line> <line>It doesn't rhyme</l...

Writing more efficient xquery code (avoiding redundant iteration)

Here's a simplified version of a problem I'm working on: I have a bunch of xml data that encodes information about people. Each person is uniquely identified by an 'id' attribute, but they may go by many names. For example, in one document, I might find <person id=1>Paul Mcartney</person> <person id=2>Ringo Starr</person> And in anoth...

XML Validation in ASP.NET MVC during load

I'm writing an ASP.NET MVC 2 application where one of the backing stores I plan to support is XML. I have a POCO that represents the settings for the site, along with an XML file to contain these settings. My question is what is the best way to validate this data as it is read from disk in to the POCO? I know I can use an XSD, or mayb...

How to add data to a dictonary in c#

Dear all, How to add data to dictonary from xml file scenerio: I've declared a dictonary like Dictonary<string,string> SampleDict=new Dictonary<string,string>(); and my xml file is like <Data> <Element ValOne="1" ValTwo="0" /> <Element ValOne="2" ValTwo="2" /> <Element ValOne="3" ValTwo="4" /> <Element ValOne="4" Val...

populate a treeview with xml file using c#

Im using c#.net windows form application. I have an xml file that contains nodes. I need to populate a treeview with the nodes present in the xml file. Also avoid repeated node names. For this my idea is while populating the treeview, copy the node names into a list and there see if the node already exits. If it already exits, go to the ...

Read/Write file metadata using C/C++

Hi, Searched through net, could't find a way to read/write file metadata using C or C++, however, there are tools available for this, and also there are API's in C# and Java to do this. But I want to do it from scratch in C or C++. For example, read/write image metadata. Have found out that there are three formats in which metadata is...

Best tools to create valid XML files from an Excel file

I need to create a script that extracts some data from a complex Excel 2003 file (with multiple sheets and different tables inside a single sheet) and produces different XML files that need to be validated against a given XSD file. My preferred language is Python; to create and validate XML files i would go with lxml. What do you sugges...

Replace existing XML file within iPhone app

Hey, I have an .xml file that is going to be shipped within my app. This file contains values that are read from it and saved as an array when the app launches. Each time the app is run, I want to check with the server if there is an internet connection. If so, I want to get the newest version of the .xml file from the server and repla...

How to print element values when iterating through XML document in PHP

I am iterating through the results of a service call to yahoo news thus: //Send service request if (!$yahooResults = file_get_contents($yahooRequest)) { echo 'Error processing service request'; } //Read result into xml document $yahooResultXml = new DOMDocument('1.0', 'UTF-8'); $yahooResultXml->loadXML($y...

Can Qt's QWebView display programatically generated XML?

Using Qt 4.6, I can dynamically add to an HTML page like this: ui->webView->page()->mainFrame()->documentElement().findFirst("body").appendInside("<i>some text</i>\n"); However, if I QWebView::load() an XML file, it displays it with the correct CSS styling (from an processing instruction), but doesn't show any changes when I do somet...

Help with XML path views

Hi all, is there any tool that will give me a view for XML fields like so. <Service> <header/> <Body> <element1/> <element2/> </Body> </Service> I want something that will show me the a view like so, if i select element1 Service/Body/element1 Is there any tool for eclipse for doing the above. Thanks. ...

Where should you put XSD documentation in order for JAXB to pick them up and put them in Javadoc?

I am developing a contract first webservice and wish to include the appropriate documentation in the schema so that it is as self descriptive as possible. What is the best practice to put XSD annotations and documentation such that JAXB picks them up and includes them in the generated Java files as Javadoc? I noticed that some elements ...

Import 5 millions records to the rails application

We need to import large amount of data(about 5 millions records) to the postgresql db under rails application. Data will be provided in xml format with images inside it encoded with Base64. Estimated size of the xml file is 40GB. What xml parser can handle such amount of data in ruby? Thanks. ...

Using a string inside the DocumentBuilder parse method (need it for parsing XML using XPath)

Hi guys! I'm trying to create a RESTful webservice using a Java Servlet. The problem is I have to pass via POST method to a webserver a request. The content of this request is not a parameter but the body itself. So I basically send from ruby something like this: url = URI.parse(@host) req = Net::HTTP::Post.new('/WebService/WebService...

Is there an XmlWriter that writes a colorful HTML-formatted output for displaying XML in a webpage?

I've got a bit of XML I want to display on my ASP.NET website as-is (for debugging purposes), and it would be nice if it was colored. This should be easy to achieve with the right kind of XmlWriter, but I don't have the time to make one myself. Is there an existing (free) component that can do this? ...

align="right" doesn't work in xml

i've never used xml before, and now i must chenge the align of text. i try to do it like in html, but it doesn't happen. maybe i do something wrong? here is he script <gallery> <title><![CDATA[<FONT SIZE="20" COLOR="#C3A25D"></FONT>]]></title> <text><![CDATA[<FONT SIZE="20" COLOR="#C3A25D">text, which i want to to be in right position</...

Simple XML over http web service

I have a simple html service, developed in django. You enter your name - it posts this, and returns a value (male/female). I need to ofer this as a web service. I have no idea where to start. I want to accept a xml request, and provide an xml response - thats it. Can anyone give ma any pointers - Googling it is difficult when you don...

Updating XML file c#

I want to replace a xml node that is not a child of the root element. how can I do it? ...

using xml type attribute for derived complex types

Hi All, I'm trying to get derived complex types from a base type in an xsd schema. it works well when I do this (inspired by this): xml file: <person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Employee"> <name>John</name> <height>59</height> <jobDescription>manager</j...