From: Oleg T. <he...@us...> - 2005-10-16 20:13:32
|
Update of /cvsroot/mvp-xml/EXSLT/v2/test/ExsltTest/tests/EXSLT/Strings In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14178/v2/test/ExsltTest/tests/EXSLT/Strings Added Files: align.xslt concat.xslt decode-uri.xslt encode-uri.xslt padding.xslt replace.xslt source.xml split.xslt tmp0000.xml tokenize.xslt Log Message: --- NEW FILE: split.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:copy-of select="str:split('a, simple, list', ', ')"/> </test1> <test2> <xsl:copy-of select="str:split('date math str')"/> </test2> <test3> <xsl:copy-of select="str:split('foo', '')"/> </test3> <test4> <xsl:copy-of select="str:split('cats and dogs', ' and ')"/> </test4> <test5> <xsl:copy-of select="str:split('', ' and ')"/> </test5> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: tmp0000.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> <?xml-stylesheet type="text/xsl" href="D:\docbook\docbook-xsl-1.66.0\fo\docbook.xsl"?> <article> <title>Article Title</title> <sect1> <title>Section1 Title</title> <para>Text</para> </sect1> </article> --- NEW FILE: decode-uri.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:value-of select="str:decode-uri('http://www.example.com/my%20r%C3%A9sum%C3%A9.html')"/> </test1> <test2> <xsl:value-of select="str:decode-uri('http://www.example.com/my%20r%E9sum%E9.html','iso-8859-1')"/> </test2> <test3> <xsl:value-of select="str:decode-uri('http://www.example.com/my%20r%E9sum%E9.html','not-supported-enc')"/> </test3> <test4> <xsl:value-of select="str:decode-uri('http://www.example.com/my%20r%E9sum%E9.html','')"/> </test4> <test4> <xsl:value-of select="str:decode-uri(url, '')"/> </test4> <test5> <xsl:value-of select="str:decode-uri(uri)"/> </test5> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: tokenize.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/"> <out> <test1> <xsl:copy-of select="str:tokenize('2001-06-03T11:40:23', '-T:')"/> </test1> <test2> <xsl:copy-of select="str:tokenize('date math str')"/> </test2> <test3> <xsl:copy-of select="str:tokenize('foo', '')"/> </test3> <test4> <xsl:copy-of select="str:tokenize('', '-')"/> </test4> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: padding.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:value-of select="str:padding(20, '_')"/> </test1> <test2> <xsl:value-of select="str:padding(5, 'abc')"/> </test2> <test3> <xsl:value-of select="str:padding(10, '')"/> </test3> <test4> <xsl:value-of select="str:padding(12)"/> </test4> <test5> <xsl:value-of select="str:padding(0, 'foo')"/> </test5> <test6> <xsl:value-of select="str:padding(-2, 'foo')"/> </test6> <test7> <xsl:value-of select="str:padding(-4)"/> </test7> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: replace.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:copy-of select="str:replace('foo bar', 'bar', 'baz')"/> </test1> <test2> <xsl:copy-of select="str:replace('foo bar', 'no', 'baz')"/> </test2> <test3> <xsl:value-of select="str:replace(email, '@', '@NOSPAM')"/> </test3> <test4> <xsl:value-of select="str:replace('', 'foo', 'bar')"/> </test4> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: source.xml --- <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="split.xslt"?> <data> <email>jo...@do...</email> <name>Danny</name> <uri>http://www.example.com/my résumé.html</uri> <list> <a>abcd</a> <b>efgh</b> <c></c> <d>kl<e>ml</e></d> </list> </data> --- NEW FILE: align.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:value-of select="str:align(name, str:padding(20, '_'), 'left')"/> </test1> <test2> <xsl:value-of select="str:align(name, str:padding(20, '_'), 'center')"/> </test2> <test3> <xsl:value-of select="str:align(name, str:padding(20, '_'), 'right')"/> </test3> <test4> <xsl:value-of select="str:align(name, str:padding(20, '_'))"/> </test4> <test5> <xsl:value-of select="str:align(name, str:padding(20, '_'), 'none')"/> </test5> <test6> <xsl:value-of select="str:align(name, str:padding(2, '*'), 'center')"/> </test6> <test7> <xsl:value-of select="str:align('', '*******', 'center')"/> </test7> <test8> <xsl:value-of select="str:align('foo', '')"/> </test8> <test9> <xsl:value-of select="str:align('foo', '******', '')"/> </test9> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: concat.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:value-of select="str:concat(list/*)"/> </test1> <test2> <xsl:value-of select="str:concat(/no/such/nodes)"/> </test2> </out> </xsl:template> </xsl:stylesheet> --- NEW FILE: encode-uri.xslt --- <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" exclude-result-prefixes="str"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:template match="data"> <out> <test1> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html',false())"/> </test1> <test2> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html',true())"/> </test2> <test3> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html',false(),'iso-8859-1')"/> </test3> <test4> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html',false(),'not-supported-enc')"/> </test4> <test5> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html%24',false())"/> </test5> <test6> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html%2sss',false())"/> </test6> <test7> <xsl:value-of select="str:encode-uri('http://www.ex%ample.com/my résumé.html',false())"/> </test7> <test8> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html',false(),'')"/> </test8> <test9> <xsl:value-of select="str:encode-uri('http://www.example.com/my résumé.html',true(),'')"/> </test9> <test9> <xsl:value-of select="str:encode-uri(uri ,true(),'')"/> </test9> </out> </xsl:template> </xsl:stylesheet> |