xml

Script to reformat XML file

Hello all, I am trying to change an XML file from one format to another and have no clue as to how to write a script for it. Can someone help, please? The source file looks like this: <Record> <FieldValue fieldName="rapportage_nihil" fieldValue="false" fieldValueIsNull="false" fieldValueNatural="false"/> <FieldValue fieldName=...

XSL numeric generate-id()

How can XSL generate a unique id attribute for every element in an XML document using XSL where the id must be numeric? The XLS below works except that the generated ids are alphanumeric and I need numeric? <?xml version='1.0' encoding='utf-8'?> <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:...

Mapping C structure to an XML element

Suppose I have a structure in C or C++, such as: struct ConfigurableElement { int ID; char* strName; long prop1; long prop2; ... }; I would like to load/save it to/from the following XML element: <ConfigurableElement ID="1" strName="namedElem" prop1="2" prop2="3" ... /> Such a mapping can be trivially done in Java/C...

Adding <span> tags to all text nodes between custom self closing tags.

I have a pair of custom self closing tags s1 and s2 defined in namespace x in my xhtml. For each tag pair s1, s2 having the same id, I want to add span tags to all the text nodes between them. Each s1, s2 tag pair have a unique id. i am looking for a XSL based solution for the same. I am using Saxon java processor for XSL. Sample input...

ASP Classic, SQL 2008, XML Output, and DSN vs DSN-Less Produces Chinese Letters

I've been having a problem for the past month and can't seem to figure out what is wrong. Here's the setup and a little background. Background: I have a web-host who was running my website on Windows Server 2003 and SQL Server 2000. One of my webpages returned a result set from a stored procedure from the SQL server as xml. Below is th...

Load parts of an XML file into a DataSet

Hi,I have a DataSet with some Datatables and I am saving this DataSet as XML file (C#) ..is there any way to load only some parts of this XML file into the DataSet when I start my program instead of loading all the file ? ...

How do I use QXmlQuery properly? (Qt XQuery/XPath)

I'm using the following code to load in an XML file (actually an NZB): QXmlQuery query; query.bindVariable("path", QVariant(path)); query.setQuery("doc($path)/nzb/file/segments/segment/string()"); if(!query.isValid()) throw QString("Invalid query."); QStringList segments; if(!query.evaluateTo(&segments)) throw QString("Unable ...

VB.Net Validate an xml against a schema (strange problem)

I have written a small XML validator, that takes in an XML file and an XML schema and validates the XML files against that schema. It works well, except for an XML file, with this content: <?xml version="1.0" encoding="utf-8"?> <xc:program xmlns:xc="http:\\www.something.com\Schema\XC10" xc:version="4.0.22.0" > <xc:namespaceDecls> ...

What is this XML Parse Error?

I am using the following script to generate a RSS feed for my site: <?php class RSS { public function RSS() { $root = $_SERVER['DOCUMENT_ROOT']; require_once ("../connect.php"); } public function GetFeed() { return $this->getDetails() . $this->getItems(); } private function dbCo...

Query decendants in XML to Linq

I have the following xml data: <portfolio> <item> <title>Site</title> <description>Site.com is a </description> <url>http://www.site.com&lt;/url&gt; <photos> <photo url="http://www.site.com/site/thumbnail.png" thumbnail="true" description="Main" /> <photo url="http://www.site.com/site/1.png" thumbnail="fals...

Twitter API question

I have a question regarding Twitter API. I came across something called "Parameters and Values" in the API console here : http://dev.twitter.com/console. What can I put here ? I want to filter the response of public statuses to only those have the Hashtag #Give .. Can I do that from here ? What language should I use here ? ...

jQuery XML loading and then innerfade effect

Hello, I think I can explain myself without code, so for brevity's sake here we go: I am using jquery to pull data from an xml and put it into a ul on the page with each xml entry as a li. This is working great! However, what I am trying to do afterwards is use the innerfade plugin to make a simple animation between each of the li's...

faster way to change xml to array(grails to flex)

I have a large xml passed from grails to flex. When flex receives the xml, it converts the xml into an associative array object. Given the large xml file, it takes too long to complete the loop, is there any way in flex to make conversion faster? Below is my sample code. <xml> <car> <model>Vios</model> <type>Sedan</type>...

xpath evaluting error in andorid

I'm running one application in android browser which contain the following code.. if (typeof XPathResult != "undefined") { //use build in xpath support for Safari 3.0 var xmlDocument = doc; if (doc.nodeType != 9) { xmlDocument = doc.ownerDocument; } results = xmlDocument.evaluate( xpathExpr, ...

How to write two-dimensional array to xml in Scala 2.8.0

The following code (copied from a question from about a year ago) works fine under Scala 2.7.7, but does not behave correctly under Scala 2.8.0 (Beta 1, RC8). import scala.xml class Person(name : String, age : Int) { def toXml(): xml.Elem = <person><name>{ name }</name><age>{ age }</age></person> } def peopleToXml(people: ...

How to use regular expression when choosing an XML node by XPath?

I need to search for XML nodes whose names look like "image*", i.e. start with 'image'. My sample XML: <a name="image.1"> <b name="image.22" /> </a> My XPath is /b[@name='image.22']. I want to write the seletion [@name='image.22'] in the form of using regular expression there. I've tried [@name='image.+'] but it doesn't work. Ple...

Write easily readable XML in Python

Is there any way other than creating a method myself to write XML using python which are easily readable? xMLFile.write(xmlDom.toxml()) does create proper xml but reading them is pretty difficult. I tried toprettyxml but doesn't seem like it does much. e.g. following is what I would consider a human readable xml: <myroot> <ent1 ...

Location of various javax.xml.* packages within the Java 6 SDK.

Alright, so recently I was using Notepad++ for all of my programming needs, but I've started using Eclipse for larger-scale Java projects now. I decided to pick up an old project of mine which used various classes within the "javax.xml.*" namespaces. When I was compiling and running the program with Notepad++ it worked just fine, howev...

what is the best approach to parse xml data to make it as generic as possible in Qt

Hello all. I'm trying to find a good and effective way to parse an XML data structure that different API calls are returning. The problem is that each time I need different data and each time I'm getting a different XML structure. Which is better: to use the SAX approach or The DOM approach? Does QT 4.6 recommend or work better with o...

Ignore order of elements using xs:extension

How can I design my xsd to ignore the sequence of elements? <root> <a/> <b/> </root> <root> <b/> <a/> </root> I need to use extension for code generation reasons, so I tried the following using all: <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://www.example.com/test" xmlns:xs="http://www.w3...