[xsl] matching node(s) between start/end processing instruction tags

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

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:

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

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.

Paul Nagai

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

Current Thread