|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Selecting First Letter
> In your case, assuming you want the character in bold to be > the initial > character inside the p, at any level, > > <xsl:template match="text()[not(preceding::text() > [count(.|current()/ancestor::p//text()) = > count(current()/ancestor::p//text())])]"> > > would do it, but you can see how horrible that is! > > Not foolproof, but > > match="text()[starts-with(ancestor::p,.)]" > > would usually work (and would most probably perform better). > > So today's XSLT Challenge is to write a better match for this problem. I think that <xsl:variable name="n"><xsl:number level="any" from="p"/></xsl:variable> <xsl:choose> <xsl:when test="$n = 1">... works reasonably, though it can't be done in the match pattern, except (in XSLT 2.0) by invoking an xsl:function from the predicate. Michael Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








