xsl-list
[Top] [All Lists]

[xsl] RE: Xpath question with processing-instruction()

2010-08-20 15:02:38
If I just copy that XML into Stylus Studio, and fire up the XPath editor, I can 
find the text node you're on, and apply the specified test:

//text()[. eq 'Text of a 
title'][../preceding-sibling::processing-instruction()/name() eq 'ModuleStart']

So it's the second test (i.e. the second bracketed expression) that you want. 
Substitute '=' for 'eq' if you're stuck with XPath 1.0. 

-----Original Message-----
From: Ylvisaker, Steve 
[mailto:steve(_dot_)j(_dot_)ylvisaker(_at_)medtronic(_dot_)com] 
Sent: Thursday, August 19, 2010 1:44 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Xpath question with processing-instruction()

I know I can do this but I'm stumped.

Please consider the following XML:

<section>
<?ModuleStart ShowIDs="yes"?>
<title>Text of a title</title>
<para>para in the section</para>
</section>



I am current to the text() node of <title/>

I need to test to see if my parent has an immediate preceding sibling of 
processing-instruction named "ModuleStart"

If so I need to know the content of that PI.


I need to be sure that the test will NOT be true if I am current with the 
text() node of <para/>

Thanks in advance for your help
Steve



[CONFIDENTIALITY AND PRIVACY NOTICE]

Information transmitted by this email is proprietary to Medtronic and is 
intended for use only by the individual or entity to which it is addressed, and 
may contain information that is private, privileged, confidential or exempt 
from disclosure under applicable law. If you are not the intended recipient or 
it appears that this mail has been forwarded to you without proper authority, 
you are notified that any use or dissemination of this information in any 
manner is strictly prohibited. In such cases, please delete this mail from your 
records.
 
To view this notice in other languages you can either select the following link 
or manually copy and paste the link into the address bar of a web browser: 
http://emaildisclaimer.medtronic.com


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--