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

Re: Is the first preceding-sibling a processing-instr

Subject: Re: Is the first preceding-sibling a processing-instruction?
From: "Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 8 May 2023 16:47:57 -0000
Re:  Is the first preceding-sibling a  processing-instr
How about

preceding-sibling::processing-instruction() except
preceding-sibling::node()/preceding-sibling::processing-instruction()

?

Presumably this should get any PI that is immediately behind the context node,
but none that are not. (Untested.)

Cheers, Wendell

From: Eliot Kimber eliot.kimber@xxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, May 8, 2023 11:31 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Is the first preceding-sibling a processing-instruction?

I interpreted the initial requirement as "If the first preceding sibling that
is not an empty text() node is a processing instruction, get that".

But the markup as shown as the starting point only has elements, PIs, and text
nodes, so for that content a simple
preceding-sibling::processing-instruction()[1] would give the right answer,
assuming there is always a PI before each element.

Cheers,

E.

_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com/>
LinkedIn<https://www.linkedin.com/company/servicenow> |
Twitter<https://twitter.com/servicenow> |
YouTube<https://www.youtube.com/user/servicenowinc> |
Facebook<https://www.facebook.com/servicenow>

From: Graydon graydon@xxxxxxxxx<mailto:graydon@xxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>>
Date: Monday, May 8, 2023 at 10:02 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
<xsl-list@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list@xxxxxxxxxxxxxxxxxxxxxx>>
Subject: Re:  Is the first preceding-sibling a processing-instruction?
[External Email]

On Mon, May 08, 2023 at 01:37:45PM -0000, Michael Kay
mike@xxxxxxxxxxxx<mailto:mike@xxxxxxxxxxxx> scripsit:
> But you could do
>
>
preceding-sibling::node()[not(self::text())][1][self::processing-instruction(
)]

I would use

preceding-sibling::processing-instruction()[1]

And I think it means "of my preceding siblings nodes which have node
type processing instruction, I want the one closest to me".

Have I got that wrong? Or is it only wanted if there's no intervening
node that's not a white space only text node?

--
Graydon Saunders | graydonish@xxxxxxxxx<mailto:graydonish@xxxxxxxxx>
^fs oferiode, pisses swa mfg.
-- Deor ("That passed, so may this.")
XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3302254> (by
email<>)

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.