Search the Community
Showing results for tags 'for-each'.
Hi I have a problem with counting the number of data rows for an XML nodes. A sample XML is listed below. <Contract> <Lease>12345</Lease> <trdate>12-sep-1990</trdate> <customer id="1"> <name>tanket</name> <country>timbaktu</country> <creditrating>500</creditrating> </customer> <Locations> <Location cillicode="13456"> <title>SharptonWorks</title> <GPSCoordinate>17:45,36</GPSCoordinate> </Location> <Location cillicode="873456">
Hello, My stylesheet failed to compile for this error: XPTY0020: Cannot select a node here: the context item is an atomic value at this line: <xsl:when test="$event[substring-before(start/datetime, 'T')=$dateJour]"> Here is all the code of the template: http://pastebin.com/fmPUHGpR. The error is on line 20. Yesterday, I search on a lot of websites and forums who says to put a global variable outside the for-each. $event is a global variable. I try to put event/start/datetime in a global variable but I still have the error. Could you please help me?
We receive an XML document that has several repeating elements. These are optional and can have from 0 to n number. We can only handle 2. How do we just get the first 2 of a set? The for-each gets all which messes up the output that we need. Below is an example of the incoming XML <opts length="4"><opt>Val1</opt><opt>Val2</opt><opt>Val3</opt><opt>Val4</opt></opts>