[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: checking sequence inside processing-instruction
> <?page 5?> > <?page 6?> > <?page 8?> > > The style sheet should tell <?page 8?> is out of sequence. > Assuming you are applying templates to processing instructions: <xsl:template match="processing-instruction('page')"> <xsl:if test="preceding::processing-instruction('page')[1][number(.) >= number(current())]"> <xsl:message>error</xsl:message> </xsl:if> </xsl:template> (The call to number() isn't needed in XSLT 1.0. It is needed in 2.0, because otherwise the values will be compared as strings. The condition will always be false if the value is non-numeric, you might want a different error message for that case. The predicate [1] is for performance reasons only.) Michael Kay http://www.saxonica.com/
|
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
|