xml

Xml Dom library with unit tests

Googled for a Xml Dom open source library that ships with unit tests, but could not find any. Are there any dom libraries, java or .net that have unit tests? ...

Python output out of order

I needed some really simple XML output so I decided to write my own functions. This was just the first step, but something has gone terribly wrong. While I would expect the output to look like this: <A> <D> <I></I> <J></J> <K></K> </D> <E> <I></I> <J></J> <K></K> </E> .....

Getting invalid Nil Object Exception when creating RSS feed in Rails

I'm creating an RSS feed for user notifications, each user has a feed unique to them which they get from a unique URL. The problem is that @notifications (set in the controller) is giving said to be a nil object, but @notifications both exists and contains data. Here's the controller code: def user_notifications render :layout => fa...

XPath query on node-set working like a SQL where in

Hi, a sample of xml document: <xml> <list> <item refid="1" /> <item refid="3" /> </list> <catalogue> <model id="1"><details /></model> <model id="2"><details /></model> <model id="3"><details /></model> </catalogue> </xml> I'd like to query something like //model[ @id = (//item/@refid...

XML Builder in Rails: 'wrong number of arguments' bug that I just can't trace

Hi folks, New to rails, and I've just spent hours trying to hunt down a bug. Any help very appreciated. I'm trying to make a rails page so that if a user enters /info/who_bought/1 the page outputs HTML, and if they enter /info/who_bought/1.xml, the page returns an XML file. (In short, I'm doing chapter 11 from the 'Agile Web Developmen...

Ways to parse XML in C++ (Win32)

Hi, I'm looking for a way to parse XML in C++ in Windows and I've found a few such as MSXML, Xerces, TinyXml etc but I'm wondering which is best in terms of performance and features. My requirements are that it must be able to be static linked or have the source included in the project itself and must not require any additional toolits ...

XML Namespace is required ?

Hello everybody I am learning xml and xml processing.I couldn't understand existence of namespace well. I learn that Namespace help us seperate same named elements in xml.Can't we discriminate elements by attributes which has same name ? Why namespace is important or required ? I want to give an example: <persons> <person></person>...

Regular Expressions in match attribute

Hello. I just want to know if it's possible to use regular expressions in the match attribute of the template element. For example , suppose i have the follow xml document: <greeting> <aaa>Hello</aaa> <bbb>Good</bbb> <ccc>Excellent</ccc> <dddline>Line</dddline> </greeting> Now the xslt to transform the above document:...

delete parent of node

I have xml, structured like this <element> <x> <y> <z>Value</z> </y> </x> </element> I select all <z>-tags from xml by this xpath query - //*[name()='z']. Then i work with every finding node, and if it not satisfied some demands a need to delete whole X-tag (grandparent of , if you like :)). forea...

Sitemap Encoding Woes

Hi, I'm having real trouble understanding the specification and guidelines on how to properly escape and encode a URL for submission in a sitemap. In the sitemap.org (entity escaping) examples, they have an example URL: http://www.example.com/ümlat.php&amp;q=name Which when UTF-8 encoded ends up as (according to them): http://www.e...

How do you store XML data in a java object from a SAX parser?

I have created a class with 3 sub classes in Java. The 3 sub classes contain variables to store information from my XML document. I am able to store in the first two for there are only single instances of the data in the XML. The third class contains variables that repeat multiple times. I want to store an object of "third class" obj...

Creating a "two way" configuration file

Hello everybody, I am writing a PHP application targeted at non-geeks, non-programmers. I need to create an option page with a bunch of "options" and then store those options...somewhere. Using a database application (MySQL/PostgreSQL/SQLite) is out of the question because it will require more configuration than the user needs to do (I ...

How to turn C# Xml Doc-Comments into something useful?

I want to compile the Xml documentation from a large project into some form that's easy to read and search, hopefully more convenient than browsing the raw source code. I'm not particularly worried about the end format - CHM, HTML, xyz - as long as it's usable. Being able to easily roll in (or link to) additional content would be a plus....

Adding data to Dictonary in C#

I've an xml file like <Data> <Element ValOne="1" Key="KeyOne" /> <Element ValOne="2" Key="KeyOne" /> <Element ValOne="3" Key="KeyOne" /> <Element ValOne="4" Key="KeyOne" /> <Element ValOne="5" Key="KeyTwo" /> <Element ValOne="6" Key="KeyTwo" /> <Element ValOne="7" Key="KeyThree" /> <Element ValOne="8" Key="KeyTh...

How to display nested XML-elements in report with XML datasource in Active Reports 6

I have following xml structure and I would like them to display in the report. {...} <order id="121"> <item> <fees> <fee id="23"> {...} </fee> </fees> <discounts> <discount id="1"> {...} </discount> </discounts> </item> <item> .... </item> </o...

CakePHP XML (1.3)

Whenever I output an xml file, I always get 9 blank lines of whitespace at the top, anyone know what the problem is? I also get a timestamp at the end which I don't want: <!-- 0.35s --> Here's the error: XML Parsing Error: XML or text declaration not at start of entity Location: http://example.com/controller/get Line Number 9, Column...

libxml2 SAX query

I am trying to parse an XML file using the SAX interface of libxml2 in C. My problem is that whitespace characters between end of a tag and start of a new tag are causing the callback "Characters" to be executed...Hi All, i.e. <?xml version="1.0"?> <doc> <para>Hello, world!</para> </doc> produces these events: ...

Snipets of code in microsoft word or open office

How can i put snippets of code, in word or open office? i am putting xml and java, if it has good formatting, even maybe a small shade in back, its even better ...

Deserialize XMLto array of objects, or singular object

I'm trying to write a generic method that can be used to deserialize xml to an array of objects. Given XML that looks like so: <people> <person> <someElement>content</someElement> </person> <person> <someElement>more content</someElement> </person> </people> Shown in the below code as xmlDoc. And a per...

How to embed .xml file into a .NET assembly?

Hi, I have to parse (for localization purpose) .NET assemblies and create satellite assemblies. Currently, I take all the resources from the base assembly, parse them, and then create the satellite assembly. Most of the parts are solved, but if I parse an assembly containing a .xml public resource, when embedding the translated xml into...