Subject: [xsl] tricky text and structure test is troubling me From: "Trevor Nicholls trevor@xxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 6 Mar 2020 16:38:50 -0000 |
At least it's proving tricky for me... Simple case, a piece of XML which looks like this <document> <title>document title</title> ... (A) ... <section> <title>section title> ... (B) ... </section> ... (C) ... </section> Assuming the current node is the <document>, I need a test which tells me whether there is going to be any *visible* content in the space labelled (A). There are complications. Firstly, it is not sufficient to just look for a text node or img element within (A) because a couple of elements have text content but are not rendered by our output stage. For example, targets. <document> <title id="a">document title</title> <target id="b">alternative title</target> <section> <title id="c">section title</title> ... </section> </document> The number of such elements is finite, in fact off the top of my head targets and footnotes are the only ones. Secondly, before the XSL process which needs to evaluate this test is run the input document is pre-processed to pull in any included sub-content. These inclusions are reflected in the document like so: <document> <title id="a">document title</title> <target id="b">alternative title</target> <included srcfile="path1.xml"> <included srcfile="path1a.xml"> <section> <title id="c">section title</title> ... </section> </included> <included srcfile="path1b.xml"> <section> <title id="d">another section title</title> ... </section> </included> </included> </document> I need to be able to tell the difference between the case where - reading in document order - the document contains a descendant text node (that isn't part of the document title or a target element), or img element, before the first section element, and the case where there isn't. I'm probably overthinking it but after much thought I have yet to arrive at a working solution. I hope I have explained this adequately! Thanks in advance T
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] group-starting-with and e, Mukul Gandhi gandhi. | Thread | Re: [xsl] tricky text and structure, David Carlisle d.p.c |
Re: [xsl] group-starting-with and e, Imsieke, Gerrit, le- | Date | Re: [xsl] tricky text and structure, David Carlisle d.p.c |
Month |