xml

Comparing 2 XML docs and applying the changes to source document

Here's my problem.I have 2 xmlfiles with identical structure, with the second xml containing only few node compared to first. File1 <root> <alpha>111</alpha> <beta>22</beta> <gamma></gamma> <delta></delta> </root> File2 <root> <beta>XX</beta> <delta>XX</delta> </root> This's what the result should loo...

XML parsing and transformation in PHP?

I have a custom XML schema defined for page display that puts elements on the page by evaluating XML elements on the page. This is currently implemented using the preg regex functions, primarily the excellent preg_replace_callback function, eg: ... $s = preg_replace_callback("!<field>(.*?)</field>!", replace_field, $s); ... function r...

Embed XML configuration directly in Spring application context

I have a Java object which is able to configure itself given an XML configuration description (it takes other descriptions as well, but I'm interested in the XML at the moment). I'm wondering if I can embed the XML description directly into a Spring application context description. I'm imagining something like: <bean id="myXMLConfigured...

Accessing stored structures for which I have an xml description

I have set up a sort of introspection-enabling C++ library that allows, using minimum macros and a fair amount of template trickery, to declare structures and classes that get enriched with some meta-information. This meta-information captures all important details about each field of the struct/class that you declare, and at the end of...

Building reports from an XML data sources

I'm looking for a graphically oriented D&D type tool/utility that can be used to build ad hoc reports from data contained in XML data files. The users are technical, but not developers -- so XSLT is right out... Eclipse' BIRT does this kind of thing, but something more lightweight is preferred. ...

XSLT, XPath and InStr

Is there a way to find a node matched on part of a value. If I have the following: <competition id="100" name="Barclays Premier League"/> <competition id="101" name="CocaCola Championship" /> <competition id="102" name="CocaCola League 1" /> Given the string "Premier League" or even "Prem", how would I match the correct node and get ...

Use of Greater Than Symbol in XML

Hi friends, I had created the xml document with xml version="1.0". In that document I need to use the greater than symbol > and less than symbol <. How should I include those symbols? It's not working. &gt; and &lt; are not working for me. Is there any special encoder for this? Please help me. ...

Linq to XML - update/alter the nodes of an XML Document

Hello! If got 2 Questions: 1. I've sarted working around with Linq to XML and i'm wondering if it is possible to change a XML document via Linq. I mean, is there someting like XDocument xmlDoc = XDocument.Load("sample.xml"); update item in xmlDoc.Descendants("item") where (int)item .Attribute("id") == id ... 2. I already know how ...

How do I add multiple namespaces to the root element with XmlDocument?

I need to create an XmlDocument with a root element containing multiple namespaces. Am using C# 2.0 or 3.0 Here is my code: XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement("JOBS", "http://www.example.com"); doc.AppendChild(root); XmlElement job = doc.CreateElement("JOB", "http://www.example.com"); root.Append...

How to write a Web Service for Google App Engine?

Hello all, I am simply wondering how to write a Web Service (XML - SOAP) for Google App Engine? I am really new with Python and I have been looking for example for a while, but no chance. Does anybody could point me out any article or simply could give me an example of a Web Service in Python with Google App Engine? Thanks! ...

node-set in xpath

Hello, everyone: I am writing a xslt style sheet to transform a xml to another xml. Here is the simplified version of original xml: <eml> <datatable> <physical> <distribution id="100"/> </physical> </datatable> <software> <implem...

Which XML structure is best suited for an all round API?

Please advise if you can. I am building an SMS web service API that will allow people to send SMS to their desired cellphone numbers. A request will be sent to the interface, we then process that request based on the account details provided and credits available on their account. We have two proposed XML structures for the interface r...

Can I have one XML-Schema (XSD) include another XML-Schema?

I currently have two XSD schemas and one is a "light" version of the other. Right now I have everything in the "light" version repeated in the "complete" schema, but this becomes a pain when I need to make a change, and it goes against the DRY principle anyways, so I was wondering if there was an element that served to include another sc...

How costly is boxing when explicitly implementing an interface

The current guidlelines for explicit member implementation recommend: Using explicit members to approximate private interface implementations. If you need to implement an interface for only infrastructure reasons and you never expect developers to directly call methods on that interface from this type then implement the members explici...

F# XML parsing

this c# code is probably not the most efficient but gets what I want done. How do I accomplish the same thing in F# code? string xml = " <EmailList> " + " <Email>[email protected]</Email> " + " <Email>[email protected]</Email> " + " </EmailList> "; XmlDocument xdoc = new XmlD...

XML/Parser.php installation

I recently signed up to shared web hosting with godaddy using Linux and PHP 5. I want to work with multiple RSS feeds. I previously had this all functioning under Apache, however, the host supplied the PEAR installation. Now I have to do this myself and I am in unfamiliar territory.I installed PEAR PHP and managed to get rss.php in the...

How to apply the XPath function 'Substring-after'

What is the XPath expression that I would use to get the string following 'HarryPotter:' for each book. ie. Given this XML: <bookstore> <book> HarryPotter:Chamber of Secrets </book> <book> HarryPotter:Prisoners in Azkabahn </book> </bookstore> I would get back: Chamber of Secrets Prisoners in Azkabahn I have tried something ...

what is the best way to update an XML node value in C#?

My function iterates through every node of an instance of an XMLDocument. It checks to see if the current node's name is in a lookup list. If it is, it applies appropriate validation to the value of the current node. When the validation method indicates that the value has been changed, I want to replace the value in the original docum...

How do I add a custom XmlDeclaration with XmlDocument/XmlDeclaration?

I would like to create a custom XmlDeclaration while using the XmlDocument/XmlDeclaration classes in c# .net 2 or 3. This is my desired output (it is an expected output by a 3rd party app): <?xml version="1.0" encoding="ISO-8859-1" ?> <?MyCustomNameHere attribute1="val1" attribute2="val2" ?> [ ...more xml... ] Using the XmlDocument/...

namespaces and specific xpath

Hi, Can anyone tell me how can I get the xpath of the name attribute from this file: <asmv1:assembly xmlns:asmv1="urn:schemas-microsoft-com:asm.v1"> <assemblyIdentity name="MyName"/> </asmv1:assembly> I'm trying to get it for nant xmlpoke task without success. Thanks. ...