[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: String Match
I replaced <xsl:template match="//li"> <xsl:copy> <xsl:apply-templates mode="copy" select="div3[ol/li='ILe']" /> </xsl:copy> </xsl:template> with <xsl:template match="//div3/li"> <xsl:if test="contains(. , 'ILe')"> <xsl:copy-of select='.'/> </xsl:if> </xsl:template> I get <li class="T"> agni;m ILe puro;hitaM yajJa;sya deva;m Rtvi;jam / </li> <li>ILe</li> as output using LotusXsl -Ana John Robert Gardner <jrgardn@xxxxxxxxx>@mulberrytech.com on 12/21/99 03:44:16 PM Please respond to xsl-list@xxxxxxxxxxxxxxxx Sent by: owner-xsl-list@xxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxx cc: Subject: String Match Also, there is the simple matter of trying to find a word in a basic heirarchy: <?xml version="1.0"?> <html> <body bgcolor="#ffffff"> <div class="Rgveda"> <div1 class="maNDala" id="1"> <div2 class="hymn" id="1.1"> <div3 class="verse" id="1.1.1"> <ol class="mantra" type="a"> <li class="T"> agni;m ILe puro;hitaM yajJa;sya deva;m Rtvi;jam / </li> <li>ILe</li> <li class="T"> ho;tAraM ratnadhA;tamam // </li> </ol> </div3> </div2> </div1> </div> </body> </html> THis does not work, nor does any multitude of versions of contains &c. (the word I'm tyring to find is ILe-- and it was even made a total freebie by fake-creating a node with only ILe as content-- in reality, I need ot get all div3's that have an <li> which contain ILe _somewhere_ within them): <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:output type="xml" indent="yes"/> <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <xsl:template match="//li"> <xsl:copy> <xsl:apply-templates mode="copy" select="div3[ol/li='ILe']" /> </xsl:copy> </xsl:template> </xsl:stylesheet> =-=-=-=-=-=-=-=-=-==-=-=-= John Robert Gardner ATLA-CERTR Emory University ------------------------------------------------------------ http://vedavid.org/diss/ "If there is something you're thinking of doing, or wish you could do, begin it. In boldness there is mystery and power . . . . " -Goethe XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list 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
|