[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl question
You need a recursive template for this. The logic is: occs(x, s): if contains(x, s) then 1 + occs(substring-after(x, s), s) else 0 The XSLT 1.0 syntax, unfortunately, is rather wordier than this. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Esteban Pizzini [mailto:eplx2002@y...] > Sent: 28 September 2004 16:17 > To: xml-dev@l... > Subject: xsl question > > Hi, > > I'm trying to write a xsl script that counts all times an > attribute contains some text > I use contain() and count(), but is it possible to count > elements that contains some value?? > I try somethins like this: > <xsl:if > test="count(contains(document($ARCH_LNK_JJ)/Doc/Laes/JudDoc/Re > f/@idproducto,$producto)) > 0"> > > but I get an error... because contains returns a boolean value.. > > thank you! > Esteban > > ----------------------------------------------------------------- > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an > initiative of OASIS <http://www.oasis-open.org> > > The list archives are at http://lists.xml.org/archives/xml-dev/ > > To subscribe or unsubscribe from this list use the subscription > manager: <http://www.oasis-open.org/mlmanage/index.php> > >
|
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
|