Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

babug_prg's scratchpad

by babug_prg (Hermit)
on Sep 28, 2006 at 13:51 UTC ( #575354=scratchpad: print w/ replies, xml ) Need Help??

Input: ======= <root> <databse>ENT ANT VNT DNT YNT KTE LSAD LJSAD SDDSFAS SADFSDF SADFS +D ASDFSDFA</databse> <textfile> sdfj sdaflkjsdf sdfljksdaf ksjldflkjsdfalkjls dsdflkj;sjdfklsdjf lsjfklsadf sdfljksdfklajksd sdfljsdfjksdj ENT ANT VNT DNT YNT KTE LSAD LJSAD SDDSFAS SADFSDF SADFSD ASD +FSDFA sdfj sdaflkjsdf sdfljksdaf ksjldflkjsdfalkjls dsdflkj;sjdfklsdjf lsjfklsadf sdfljksd ENT ANT VNT DNT YNT KTE L fklajksd sdfljsdfjksdj ENT ANT VNT DNT YNT KTE L </textfile> </root> xsl: ====== <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"> <xsl:variable name="filename" select="unparsed-text(base-uri(.))" +/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="root"> <!--<xsl:variable name="finale_value" select="for $i in tokenize(./child::databse,' ') return (matches($i,$txt_value,'i'))"/>- +-> <xsl:variable name="finale_value1" select="tokenize(child::databse,' ')"/> <xsl:for-each select="tokenize(child::databse,' ')"> <xsl:variable name="y" select="normalize-space(.)"/> <xsl:variable name="x"> <xsl:analyze-string select="$filename" regex="($y)" flags="s"> <xsl:matching-substring> <city><xsl:value-of select="regex-group(1)"/></city> </xsl:matching-substring> <xsl:non-matching-substring> <xsl:value-of select="$y"/> </xsl:non-matching-substring> </xsl:analyze-string> </xsl:variable> <xsl:message select="$x"></xsl:message> </xsl:for-each> </xsl:template> </xsl:stylesheet>
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2016-06-30 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (389 votes). Check out past polls.