|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: replacing parts of a string
"Jonny Pony" <jonnypony666@xxxxxxxxxxx> wrote in message news:Law14-F89Gad6bd89m000009edc@xxxxxxxxxxxxxx > Hi, > > OK. Downloaded your files. Did the things you said. > Now call me dumb: > I don't know how to invoke your "template". > > Let's say I have: > <hello> > <LongString>12rt,dsfg,dsfg,ewrt,wert,xcvbs,rwete,ehgfh,xxxxxasd,awersdf,dfgx vxcv</LongString> > <LongString>76rt,dsfg,dsfg,ewrt,wert,xcvbs,rwete,ehgfh,xxxxxasd,awersdf,dfgx vxcv</LongString> > <LongString>wert,ds4,dsfg,ewrt,wert,xcvbs,rwete,ehgfh,xxxxxasd,awersdf,dfgxv xcv</LongString> > <LongString>wert,d12,dsfg,ewrt,wert,xcvbs,rwete,ehgfh,xxxxxasd,awersdf,dfgxv xcv</LongString> > </hello> > > What would I "do" in my xsl to invoke your "function"? > Sorry, but I have no clue. Answer: Nothing. Just run the transformation. The result is: <LongString> 12rt, dsfg, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> <LongString> 76rt, dsfg, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> <LongString> wert, ds4, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> <LongString> wert, d12, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> If you want to copy all other nodes (unchanged) just put the identity rule as the first template in the stylesheet: <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> Now the output is: <hello> <LongString> 12rt, dsfg, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> <LongString> 76rt, dsfg, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> <LongString> wert, ds4, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> <LongString> wert, d12, dsfg, ewrt, wert, xcvbs, rwete, ehgfh, xxxxxasd, awersdf, dfgxvxcv</LongString> </hello> Dimitre Novatchev. FXSL developer, http://fxsl.sourceforge.net/ -- the home of FXSL Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html 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








