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

RE: checking sequence inside processing-instruction

Subject: RE: checking sequence inside processing-instruction
From: "Houghton,Andrew" <houghtoa@xxxxxxxx>
Date: Mon, 11 Aug 2008 09:06:24 -0400
RE:  checking sequence inside processing-instruction
> From: Ganesh Babu N [mailto:nbabuganesh@xxxxxxxxx]
> Sent: Monday, August 11, 2008 8:17 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  checking sequence inside processing-instruction
>
> I am testing the saxon:get-pseudo-attribute() function in my xslt 1.0
> style sheet to generate the HTML view.
>
> My processing-instruction as follows:
>
> <?PAGEBREAK id="PAGE0001" number="i"?>
>
> this XSL is not generating any info related to number information.
> even i tried with the @id then it is displaying the following message:
>
> Warning: on line 162 of file:/D:/ganesh-schemas/xml/gae.xsl:
>   The attribute axis starting at a processing-instruction node will
> never select
>  anything

Here is an example you can adapt:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/theme/searchRetrieveResponse.xsl"  ?>
<document/>

<?xml version="1.0"?>
<xsl:transform version="1.0"
  exclude-result-prefixes="saxon xsd xsi xsl"
  xmlns:saxon="http://saxon.sf.net/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
  <xsl:output method="xml" version="1.0"
    media-type="text/xml" encoding="utf-8"
    omit-xml-declaration="no" indent="yes"
  />
  <xsl:template match="/">
    <document>
      <name><xsl:value-of
select="name(/processing-instruction()[1])"/></name>
      <value><xsl:value-of select="/processing-instruction()[1]"/></value>
      <name>@type</name>
      <value>
        <xsl:for-each select="/processing-instruction()[1]">
          <xsl:value-of select="saxon:get-pseudo-attribute('type')"/>
        </xsl:for-each>
      </value>
    </document>
  </xsl:template>
</xsl:transform>

I wish Saxon had an extension function saxon:get-pseudo-attributes($pi as
processing-instruction) ==> xs:string* which returned the name/value pairs.


Andy.

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.