I am creating an XSLT that transforms a table.
I would like to know the number of the element with an arbitrary attribute value among the children of my parent's older brother (preceding-sibling).
For example, in XSLT for the following XML, when matching
<topic> <title/> <body> <table> <tgroup cols = "3"> <colspec/> <colspec/> <colspec/> <tbody> <row> <entry more rows = "1">AD</entry> <entry>B</entry> <entry>C</entry> </row> <row> <entry>E</entry> <entry>F</entry> </row> <row> <entry>G</entry> <entry>H</entry> <entry>J</entry> </row> </tbody> </tgroup> </table> </body> </topic>
I set the following variables in the relevant part of XSLT, but I can't get the value I want due to an error.
<xsl: template match = "entry"> <!-The first<row>skips the following processing-> <xsl: variable name = "morerows_entry_num" select = "position (parent :: node (preceding-sibling :: node ()/entry [@ morerows = 1]))" /> <!-Hereafter, the process is branched based on the acquired information->
Would you please point out any inadequacies in the description?
If i can't combine XPath in the first place, is there a way to get the above information?
Answer # 1
I didn't understand the meaning of "overlapping reference points" and "combining XPath".
Among the children of the previous
whose attribute value of morerows is 1 (@ morerows = "1") is the number in that
Translated verbatim, it looks like this:
<xsl: variable as = "xs: integer?" name = "morerows_entry_num" select = " (: In the previous row :) parent :: row/preceding-sibling :: row  (: Among children, entry with @ morerows = 1 is :) /entry [@morerows = 1] (: What number entry in that row :) /count (preceding-sibling :: entry |.) "/>
- please tell me how to write fast without using for in python
- please tell me how to write the type declaration part in c ++
- C # simple way to write xml file
- C # create, read, write XML file
- swift - please tell me how to write extensions that apply only to [indexpath]?
- [php] xml operations (xpath)
- C # read and write XML file example code
- xpath (xml path) - xpath i don't know
- xpath (xml path) - i want to get the data displayed on the screen all at once, but only 15 can be obtained
- xml - i want to write a recipe for item preparation in json
- [java] why is it possible to write the iterator's next method in the conditional expression of the while statement?
- xpath (xml path) - i have a question about writing xpath in xslt 20
- sqlite - please teach how to write a sql statement under a certain condition
- java - please tell me how to write the value of list to a variable
- swift - please tell me how to write to find an element from a multidimensional array using a higher-order function
- linq to sql - please tell me how to write sql statements in linq
- xpath (xml path) - about variable assignment to the part surrounded by double quotation marks
- XML menu tree using PHP and XSLT
- xml - about the number of results of selectnodes
- html - how to specify the attribute value of the place that contains the text specified by xpath
- use xml and xsl files i want to make a table
- causes of garbage generated when xml is converted to html with xsl (added)
- xml - get from atomapi and get all urls of specified word with xpath
- xpath (xml path) - i want to specify a variable obtained with xsl: param as an element name
- java - in the xpath evaluation expression, i want to distinguish between the case where the tag does not exist and the case wher