xml

Repost: Creating a RSS feed with PHP

I asked how to do this before but it seems I needed to put more code to really get an answer. I have a reddit type site, and I am trying to create a rss feed this is the code, but I get a Fatal error: Uncaught exception 'Exception' with message 'Query failed' Here its the code: <?php require_once($_SERVER['DOCUMENT_ROOT'].'/config.php...

JAXB: How do I annotate classes so that they belong to different namespaces?

Hello! I want to have JAXB-annotated classes which would be marshalled/unmarshalled to different XML namespaces. What I need is something like: <someRootElement xmlns="urn:my:ns1" xmlns:a="urn:my:ns2" xmlns:b="urn:my:ns3"> <someElement/> <a:someElement/> <b:someElement/> </someRootElement> How can it be done? Can it be ...

XML element unique id Schema repersentation

My XML looks likes this : <company> <employee id="1">Larsen</employee> <employee id="2">Smith</employee> <employee id="3">Sam</employee> </company> How to write a xml schema so that employee element is defined such a way that each employee has a unique id attribute (no two employee elements can have same value for id attribute) ...

Best storage approach for small amount of 99% static data needed at startup?

I have some (small amount) of data that I'll need quick access to on inital load, but not after that. Right now, I have serialized the data (Generic List) to an Xml file and I'm deserializing it on load as needed. My question is should I use the XmlSerializer or the BinaryFormatter? I'm not worried about file size, but serialization sp...

XPath - How can I query for a parent node satisfying an attribute presence condition?

I need to query a node to determine if it has a parent node that contains a specified attribute. For instance: <a b="value"> <b/> </a> From b as my focus element, I'd like to execute an XPath query: ..[@b] that would return element a. The returned element must be the parent node of a, and should not contain any of a's siblings....

Does XDocument.Save(string filename) resave the whole file or just changes?

Basically if I do Xdoc.Load(filename), do some changes then do Xdoc.Save(filename) does it only save things that changed such as inserted or removed elements, etc, or does it resave everything? Depending on the answer I'm thinking of determining whether my app is going to save per-change or save on explicit save and on exit. Also consi...

xpath with curl gives empty result?

This code gives me an empty result. I expect it to print out the titles from the XML-file. I need to use Curl to get the file. <?php function get_url($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); $data = curl_exec(...

Special characters in XML files - processing with the DOM API

Hello, I have a file, which is in XML format (consists just of root start and end tags, and children of the root). The text elements of the children contain the ampersand symbol &. In XML it is not allowed to have this symbol in order the document to be valid, and when I tried to process the file using the DOM API in Java and an XML par...

How to write (big) XML to a file in C#?

Folks, Please, what's a good way of writing really big XML documents (upto say 500 MB) in C# .NET 3.5? I've had a bit of search around, and can't seem to find anything which addresses this specific question. My previous thread (http://stackoverflow.com/questions/676274/what-is-the-best-way-to-parse-big-xml-in-c-code) covered reading si...

Creating a nested tree structure from a path in XSLT

I have a dynamic XML document which represents a tree structure of categories, but does so using path separated attributes in arbitrary order - like this: <data> <record ID="24" Name="category 1\sub category 1"/> <record ID="26" Name="category 1"/> <record ID="25" Name="category 1\sub category 1\sub cate...

Problem with processing "specific" characters in text (in Java, using XML parser)

Hi, I have problems when processing "specific" characters in texts using the DOM API in Java. The files are in XML format. I was told in a previous post what the situation with the ampersand (&) symbol in XML is (and several more characters such as < and >). Here is the post: http://stackoverflow.com/questions/871963/special-characters-...

XML Signature in a Web application

Hi, We are developing an e-Banking web application for a small bank (up to 20000 clients/users). We have to implement digital signatures with X509 certificates (issued by CA on USB tokens) for signing payment information. We tried using CAPICOM but it seems that it is not working well with Windows Vista (have not tried it with Win 7). T...

xmlns:soap attribute of SOAP element

I just now started learning web services.I cannot understand the use of xmlns:soap attribute of SOAP element.Thanks. ...

how to pass complex queries in rest???

If I understand correctly, in rest style, every query (that is, every action on every resource that does not modifies the resource's state) should be enconded in the querystring, using a get method, with no body at all... am I right? well, I have several applications that comunicate with the db thru an xml message that is handled by a ...

Most effective way to process a string containing XML, in JAVA

Hello, I have a String which contains XML nodes within it, and am seeking to use DOM parsing to process this string to extract node values and store them in local variables. The XML which is stored in a String variable: <carGarage> <car> <make>Chrysler</make> <color>Red</color> </car> <car> <make>Musano</make...

Auto-binding an "XElement" property in ASP.NET MVC

I have an "Edit" action and an "Edit" view to allow users to update a certain entity in the database. It's database type is "XML", and the DataContext (I'm using Linq-to-SQL) represents it as a property of type "XElement". In my view, I render a text-area from the "ToString()" output of the propery like this: <%= Html.TextArea("Text",...

How to indent after newline in xml element value when using an XmlTextWriter?

I am trying to indent after a newline when using an XmlTextWriter So essentially i want this <?xml version="1.0" encoding="utf-16"?> <element> a </element> but using the code below i get this <?xml version="1.0" encoding="utf-16"?> <element> a </element> Here is my current test harness [Test] public void XmlIndentingTest() { ...

Jibx: Integrate base class output into extending class output

I have this class model: abstract class A { int a; } class B extends A { int b; } class C extends B { int c; } And I'd like to get jibx to output this XML: <B b=1 a=0> <children> <C c=2 b=1 a=0/> </children> </B> I have this binding xml: <binding> <mapping class="A" abstract="true"> <value nam...

XML design - How to?

We are currently working on the design of a RESTful application. We have decided on XML as our basic representation. I have the following questions regarding designing/modeling the application data in XML. What are the approaches towards data modeling in XML? Is it a good idea to start from scratch and then evaluate the use of standar...

Edit Xml Node

I have an xml document where an xml node with a particular name, say 'Data' can appear anywhere in the xml document i.e anywhere in the hierarchy. I need to read these nodes with their node name alone and edit the node attributes. What is the easiest way to do it? ...