[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

questions about preceding::processing-instruction

Subject: questions about preceding::processing-instruction
From: "Erik Zander erik.zander@xxxxxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Apr 2017 13:12:00 -0000
 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.'), '&quot;')"/>

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.