So a while back I asked a question here about matching a child of level “file” that has a parent of level “file”. The solution was as follows:
<xsl:template match="*[@level='file' ]/*[@level='file']">
This worked at the time, but I now realize I need to match beyond a second level. So in addition to matching this:
<c01 level="file">
<c02 level="file"></c02>
</c01>
I further need to match this and beyond:
<c01 level="file">
<c02 level="file">
<c03 level="file"></c03>
</c02>
</c01>
In short, is there a way to match ANY node in the document of level “file” that has a direct parent of level “file” no matter the depth? I need this to specify indentation in an xsl-fo document. I really just need my stylesheet to continue indenting children further than their parents.
I hope this make a modicum of sense. Thanks!
This XPath expression matches any node with
level="file"whose parent also haslevel="file". Is it what you need?