Category Archives: Xml

Implementing a DSL in C# for generating domain specific XML

Questions: I have a legacy HTTP/XML service that I need to interact with for various features in my application. I have to create a wide range of request messages for the service, so to avoid a lot of magic strings littered around the code, I’ve decided to create xml XElement fragments to create a rudimentary… Read More »

Parsing XML in R: Incorrect namespaces

Questions: I have a bunch of XML files and an R script that reads their content into a data frame. However, I got now files which I wanted to parse as usual, but there is something in their namespace definition that doesn’t allow me to pick their values normally with XPath expressions. XML files are… Read More »

Regular expression to parse xml in .net

Questions: I have the following function that I am using to remove the characters \04 and nulls from my xmlString but I can’t find what do I need to change to avoid removing the \ from my ending tags. This is what I get when I run this function <ARR>20080625<ARR><DEP>20110606<DEP><PCIID>626783<PCIID><NOPAX>1<NOPAX><TG><TG><HASPREV>FALSE<HASPREV><HASSUCC>FALSE<HASSUCC> Can anybody help me find… Read More »

Transform XML with XSLT in PHP

Questions: I’m trying to combine two xml-files and with a XSLT-file transform them into a XHTML-page. I have not done this before and can´t figure out how to do it. This is what I have so far, with just one xml-file: <?php $xsl = new DOMDocument(); $xsl->load(“file.xsl”); $inputdom = new DomDocument(); $inputdom->load(“file.xml”); $proc = new… Read More »

Return XML data from a web service

Questions: What is the best way to create a web service that returns a set of x,y coordinates? I am not sure on the object that is the best return type. When consuming the service I want to have it come back as xml preferibly something like this for example: <TheData> <Point> <x>0</x> <y>2</y> </Point>… Read More »

How to filter xml nodes by nested children values in ActionScript 3?

Questions: I have a very simple scenario where I have a structure similar to this <tours> <tour> <name>Italy 1</name> <destinations> <destination>Rome</destination> <destination>Milan</destination> <destinations> </tour> <tour> <name>Italy 2</name> <destinations> <destination>Rome</destination> <destination>Venice</destination> <destinations> </tour> </tours> Now I want to query all the tours that go to Milan. Below is the logical format that I can think of… Read More »

magento appends a querystring parameter to CSS and JS

Questions: How Can I appends a querystring parameter to each CSS and JavaScript include in the HTML to clear CSS and JavaScript cache. I have tried <action method=”addCss”><stylesheet>css/style.css?123</stylesheet></action> and <action method=”addItem”><type>skin_css</type><name>css/styles.css?123</name><params/></action> . But each time it returns a the base package like not my custom theme directory . How to solve this ? Answers:… Read More »

Does “find” return nodes in order?

Questions: Do XML::LibXML::Node::find and related methods guarantee that the list of nodes will always be ordered as in the XML document? This is important for me because my document corresponds to a big array in which I want to be able to delete series of items in certain circumstances, and I must make sure something… Read More »

Category: Xml