limited iteration
-
Hi all, I'm fairly new to xsl so please bare with me if this is a trivial issue. I'm getting my XML from a database so it's just a string of row nodes with nodes representing the values of the row within. Mostly it is one row per page. However, sometimes it is more, maximum 4 rows per page. Each row node has a child node rowsequence which states what number row on the page the row should be. So far I have been able to get to the beginning of each sequence of row nodes as follows: However, I am not sure what to do next. How, to iterate over the following nodes that are supposed to be on the same page. all I can see is the logic should be: starting from the first node in the sequence keep iterating forward until you find a row node whose rowsequence node has a value of 1. If anyone show me how to write this into XSL it would greatly appreciated. Thank you for any help PS I'm using XSL 2.0 (Saxon 8) Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.
-
Hi all, I'm fairly new to xsl so please bare with me if this is a trivial issue. I'm getting my XML from a database so it's just a string of row nodes with nodes representing the values of the row within. Mostly it is one row per page. However, sometimes it is more, maximum 4 rows per page. Each row node has a child node rowsequence which states what number row on the page the row should be. So far I have been able to get to the beginning of each sequence of row nodes as follows: However, I am not sure what to do next. How, to iterate over the following nodes that are supposed to be on the same page. all I can see is the logic should be: starting from the first node in the sequence keep iterating forward until you find a row node whose rowsequence node has a value of 1. If anyone show me how to write this into XSL it would greatly appreciated. Thank you for any help PS I'm using XSL 2.0 (Saxon 8) Cheers Tom Philosophy: The art of never getting beyond the concept of life. Religion: Morality taking credit for the work of luck.
Please post some sample XML data and the desired XSLT output so that I can help you better.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
-
Please post some sample XML data and the desired XSLT output so that I can help you better.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
Hi, thanks for the interest. Here's a chunk of the XML, simplified so as not to consume too much space. As you can see there should be 3 pages of output. Whenever the BLOCKSEQUENCE value returns to 1 a new page started. Therefore, there should be three tables on three pages. The first table should have three rows. The second should have two rows and the third should have one row. I am at a loss as to how to iterate over this XML in such a way as how to do this. XSL-FO to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 3 to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 1 My XSL so far is as follows
-
Hi, thanks for the interest. Here's a chunk of the XML, simplified so as not to consume too much space. As you can see there should be 3 pages of output. Whenever the BLOCKSEQUENCE value returns to 1 a new page started. Therefore, there should be three tables on three pages. The first table should have three rows. The second should have two rows and the third should have one row. I am at a loss as to how to iterate over this XML in such a way as how to do this. XSL-FO to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 3 to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 1 My XSL so far is as follows
Your XML was not valid so I used the following: XSL-FO to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 3 to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 1 For illustration, I transformed this XML to HTML into 3 sets of tables. The key to the transformation is to get the first following sibling of ROW "following-sibling::ROW[1]" and the "blocksequence" parameter that stops the recursion when BLOCKSEQUENCE does not equal it.: Output:
1:
XSL-FO to describe the row of a table
2:
to describe the row of a table
3:
to describe the row of a table
1:
to describe the row of a table
2:
-
Your XML was not valid so I used the following: XSL-FO to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 3 to describe the row of a table 1 to describe the row of a table 2 to describe the row of a table 1 For illustration, I transformed this XML to HTML into 3 sets of tables. The key to the transformation is to get the first following sibling of ROW "following-sibling::ROW[1]" and the "blocksequence" parameter that stops the recursion when BLOCKSEQUENCE does not equal it.: Output:
1:
XSL-FO to describe the row of a table
2:
to describe the row of a table
3:
to describe the row of a table
1:
to describe the row of a table
2:
Thanks George :)
Cheers Tom Philosophy: The art of never getting beyond the concept of life.
Religion: Morality taking credit for the work of luck.
"The object of life is not to be on the side of the majority, but to escape finding oneself in the ranks of the insane." - Marcus Aurelius