[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] questions about preceding::processing-instruction
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:variable name="currentPage" select="substring-before(substring-after(((./preceding::processing-instructio n('anchor'))[last()]), 'Page.'), '"')"/> Which works (although I don't 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|