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

matching node(s) between start/end processing instruct

Subject: matching node(s) between start/end processing instruction tags
From: "Nagai, Paul" <pnagai@xxxxxxxxxxx>
Date: Mon, 24 Feb 2003 11:49:33 -0800
paul nagai
Howdy,

I want to change spaces between nolinebreak start and end processing
instructions. My xml looks like this:
	<?Pub _nolinebreak?>word1 word2<?Pub /_nolinebreak?>

I want my output to be:
	word1&nbsp;word2

My template (which handles the unpaired _newline pi just dandy) looks like
this:
=======
<xsl:template match="processing-instruction('Pub')">
  <xsl:variable name="mypi">
    <xsl:value-of select="."/>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="$mypi='_newline '">
      <br/>	
    </xsl:when>
    <xsl:when test="$mypi='_nolinebreak '">
        what goes here?
    </xsl:when>
    <xsl:otherwise></xsl:otherwise>
  </xsl:choose>
</xsl:template>
=======

Don't ask why the test requires a space at the end of the PI. I don't know.
I don't like it much either!

I expected to be able to match the start/end components of the PIs and a
node. Instead, I'm matching either the start (_nolinebreak) or the end
(/_nolinebreak) PI tag. Best would be a way to match them as a node. Ok,
would be to see some code that handles the xpath manipulation required to
select the nodes between them (I could have a mix, I guess).

I'm using Epic/Xalan.

Thanks.
------
Paul Nagai

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.