Subject: Re: [xsl] questions about preceding::processing-instruction From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 10 Apr 2017 13:30:33 -0000 |
Hi All!
I have an optimization problem concerning preceding::processing-instruction.
First some background in my xml I have processing instructions like <?anchor xml:id="orgPage.7"/?> representing the start of a page.
And I have a template that matches on *text().*
In the template matching on text() I want to know the page number.
To get this I have in the text template declared a variable as
<xsl:variablename="currentPage"select="substring-before(substring-after(((./preceding::processing-instruction('anchor'))[last()]), 'Page.'), '"')"/>
Which works (although I donbt see why as I had the understanding that preceding:: returned in reverse document order) but it takes up a great deal of the processing time.
So my questions are:
Is there a better (faster/smarter) way to get the page from the processing instruction.
And is it the expected behavior that calling preceding:processing-instruction() gives me
<?anchor xml:id="orgPage.1"/?>
<?anchor xml:id="orgPage.2"/?>
<?anchor xml:id="orgPage.3"/?>
<?anchor xml:id="orgPage.4"/?>
I have this behavior in both Saxon 9.6.0.7 and Marklogic.
Regards
Erik Zander
XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <-list/225679> (by email <>)
-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930
GeschC$ftsfC<hrer: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt, Dr. Reinhard VC6ckler
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] questions about preceding::pr, Erik Zander erik.zan | Thread | SV: [xsl] questions about preceding, Erik Zander erik.zan |
[xsl] questions about preceding::pr, Erik Zander erik.zan | Date | SV: [xsl] questions about preceding, Erik Zander erik.zan |
Month |