xml

I need an XSLT transformation that separates nodes based on a comparison between child nodes and that make a calculation as a result.

This is a bit complex and I really don't now if it is possible. I got this XML: <XML> <member> <InicialAmount>10000000</InitialAmount> <Flows> <Payment> <Date>20100621</Date> <Period> <Amount>10000000</Amount> <StartDate>20100521</StartDate> <EndDate...

using an attribute name in an xQuery

Hi all! I have this Xml: <Item key = "id"> <SubItem id = "1" a = "2"/> <SubItem id = "1" b = "3"/> <SubItem x = "1"/> <SubItem y = "1"/> <SubItem z = "1"/> </Item> I wish to select the SubItems that have an attribute whose name equals the value of. key Meaning I want a query that returns these guys: <SubItem id = "1...

Random TransformerException, how to solve it?

My app writes a lot of XML data, and randomly the last line of the following piece of code: // Prepare the DOM document for writing Source source = new DOMSource(node); // Prepare the output stream Result result = new StreamResult(stream); // Write the DOM document to the file Transformer xformer = TransformerFactory.newInstance().new...

Excel to XML in C#

How would I go about converting an Excel file to an XML document using C#? ...

Flex XMLList Intersections, Unions, Differences

I don't think Flex supports anything like this, but I'm new to it and thought it couldn't hurt to ask anyway before I go off and implement it myself. I'm basically wondering if Flex can give me the union or difference or intersection of two XMLLists, as in Python's sets: >>> a = set([1, 2, 3]) >>> b = set([3, 4, 5]) >>> b.difference(a) ...

When is it OK to use an XML file to save information?

What reason could there be for using an XML to save information? ...

How to POST an xml element in python

Basically I have this xml element (xml.etree.ElementTree) and I want to POST it to a url. Currently I'm doing something like xml_string = xml.etree.ElementTree.tostring(my_element) data = urllib.urlencode({'xml': xml_string}) response = urllib2.urlopen(url, data) I'm pretty sure that works and all, but was wondering if there is some ...

Really simple way to deal with XML in Python?

Musing over a recently asked question, I started to wonder if there is a really simple way to deal with XML documents in Python. A pythonic way, if you will. Perhaps I can explain best if i give example: let's say the following - which i think is a good example of how XML is (mis)used in web services - is the response i get from http re...

How to output XML safe string in PHP?

I am doing some stuff that needs to output xml(utf-8) using PHP scripts. It has strict format requirements, which means the xml must be well formed. I know 'htmlspecialchars' to escape, but I don't know how to ensure that. Is there some functions/libraries to ensure everything is well formed? ...

retreiving information from curl

hi ! i am retriving information from soundcloud using curl.it gives lot of information .but i want to filter it . <?php $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'http://api.soundcloud.com/tracks '); curl_exec($curl_handle); curl_close($curl_handle); ?> how can i filter information coming from it l...

How to add Process Instruction to an XML file in C#

How to add process instruction to an xml file after creating it. My application has more than 50 xml file ... i need to add Process Instruction to each file. <?xml-stylesheet type="text/xsl" href="Sample.xsl"?> If i append the node it is added to the end of the file. How to add it as the first node of the file Please help me to ...

Capture the last occurrence of a tag

My text is of the form: <Story> <Sentence id="1"> some text </Sentence> <Sentence id="2"> some text </Sentence> <Sentence id="3"> some text </Sentence> My task is to insert a closing tag </Story> after the last </Sentence>. In the text, every </Sentence> is followed by 3 spaces. I tried capturing the last </Sentence> using...

Retrieve full path of a file using javascript

hello., i would like to retrieve fullpath of a file and pass it to javascript.. the requirement is that i need to retrieve xml file using javascript. ...

How to get the value of an attribute whose name is not a literal in xQuery?

For example: let $targetAtt "= "att1"; let $doc := <Xml att1 = "la", att2 = "la la"> So this works: return $doc/@*[(name(.) = $targetAtt)] But is a more succinct syntax possible? For example: the following Does not work such as return $doc/@$targetAtt. Thanks ! ...

is square bracket valid in xsl tag

I want design something like... <DB[0]><xsl:value-of select="test"><DB[0]> which will update the database table field DB[0] with data test. But it's not working ...as xsl is not allowing [] bracket. ...

How to display attributes depending upon the attribute value using XSLT ?

Hi All, We are using XSLT to display xml attributes depending upon their value. We are able to do it from server side using C#. But we are not getting how to achieve it through XSLT. We are using sample xml as; <BookInfo> <BookTable show="Book 1" > <book id="book1" value="Book 1" /> <book id="book2" value="Book 2" /> ...

JAXB and XHTML inside XML

Hi, I'm using Apache cxf to create objects from a WSDL. Everything works fine but I have some XHTML inside the SOAP message and i don't know how to access it. The resulting xml is <folder> <id S="ID-KMEHR" SV="1.0" SL="idfolder">1</id> <patient> <id S="ID-PATIENT" SV="1.0" SL=" ">05040199</...

Assigning xml generated by a while loop to a variable

Hi guys, I am creating XML using a while loop, but now I need to prepend and append the generated XML with the XML header info and wrapper tag, but I am struggling to get it to work, here is my code, $result = mysql_query("SELECT * FROM users") or die(mysql_error()); $row = mysql_fetch_array($result); while ($row = mysql_fetch_arr...

iterating SimpleXml xpath result

I'm using SimpleXMLElement to read xml returned from a remote server. The results are then parsed with xpath like this: $result = <<<XML <DataImport2Result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xxx.xxx/Services/DataImport2"&gt; <Number /> <Blocks> ...

and and or condition in single xml statement

I want to construct a statement containing and and multiple or expressions in xml like <xsl:choose> <xsl:when test="VAR1 and VAR1/text() != 'A' | 'B' | 'C'"> <xsl:value-of select="$data"/> </xsl:when> <xsl:otherwise>0.0</xsl:otherwise> </xsl:choose> but its nt working... ...