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

Saxon 6.5.3: apply-templates="processing-instruction()

Subject: Saxon 6.5.3: apply-templates="processing-instruction()"
From: "Steven Anderson" <sanderson@xxxxxxxxxxxxxx>
Date: Wed, 27 Apr 2005 11:24:31 -0700
saxon processing instruction
Forgive me if this is an obvious question, but I'm a newbie trying to
figure out how to handle processing-instructions with XSLT.

Using Saxon 6.5.3, I'm trying to apply a template defined like this:

<xsl:template
match="processing-instruction('FM')[substring-before(substring-after(.,'
MARKER ['), ']')='Filename']">

I thought I could just do the following:

<xsl:apply-templates select="processing-instruction()" />

But if I do that, the other template never gets applied.  If I change
the line to

<xsl:apply-templates select="node()" />

I get the output that I want, but a lot of other output as well.

I have tried

<xsl:apply-templates
select="processing-instruction('FM')[substring-before(substring-after(.,
'MARKER ['), ']')='Filename']" />

But that doesn't work, either.

Here's the entire stylesheet, just in case it helps.
-----

<?xml version='1.0' ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text"/>

  <xsl:template match="dita">
    <xsl:variable name="crossRefId" select="@Id"/>
    <xsl:value-of select="$crossRefId"/>
    <xsl:apply-templates select="processing-instruction" />
  </xsl:template>

<xsl:template
match="processing-instruction('FM')[substring-before(substring-after(.,'
MARKER ['), ']')='Filename']">
    <xsl:variable name="filename" select="substring-after(.,
                                        '[Filename] ')" />
    <xsl:value-of select="$filename"/>
  </xsl:template>

</xsl:stylesheet>

-----
The $crossRefId variable is set and output, but $filename isn't output.

Any ideas?

     Steve

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.