[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|