!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/lib/4Suite/tests/Xml/Xslt/Core/   drwxr-xr-x
Free 4.44 GB of 27.03 GB (16.44%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_ft_funcs.py (4.11 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from Xml.Xslt import test_harness

SHEET_1 = """<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ft="http://xmlns.4suite.org/ext"
  extension-element-prefixes="ft"
  version="1.0"
  >

  <xsl:output method="text"/>
  
  <xsl:template match="/">
    <xsl:variable name='matches' select="ft:search-re('([a-z])([0-9])', 'a1b2c3d')"/>
    <xsl:apply-templates select='$matches'/>
  </xsl:template>

  <xsl:template match="Match">
    <xsl:text>Match 1 groups:</xsl:text><xsl:apply-templates/><xsl:text>&#10;</xsl:text>
  </xsl:template>
  
  <xsl:template match="Group">
    <xsl:text> "</xsl:text><xsl:apply-templates/><xsl:text>"</xsl:text>
  </xsl:template>
  
</xsl:stylesheet>
"""

##from Eric van der Vlist
##preg_match_all("Call 555-1212 or 1-800-555-1212 or (612) 555-1313",
##"/\(? (\d{3})? \)? (?(1) [\-\s] ) \d{3}-\d{4}/x")

##would return a nodeset whose structure could be:
##<Match>
##  <Group></Group>
##  <Group></Group>
##  <Group>555-1212</Group>
##</Match>
##<Match>
##  <Group>1</Group>
##  <Group>-800-</Group>
##  <Group>5551212</Group>
##</Match>
##<Match>
##  <Group></Group>
##  <Group>(612) </Group>
##  <Group>555-1213</Group>
##</Match>

SHEET_2 = """<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ft="http://xmlns.4suite.org/ext"
  extension-element-prefixes="ft"
  version="1.0"
  >

  <xsl:output method="text"/>
  
  <xsl:template match="/">
    <xsl:variable name='matches' select="ft:search-re('(1)?([(-]?\d{3}?[)-]?\s?)?(\d{3}-\d{4})', 'Call 555-1212 or 1-800-555-1212 or (612) 555-1313')"/>
    <xsl:apply-templates select='$matches'/>
  </xsl:template>

  <xsl:template match="Match">
    <xsl:text>Match 1 groups: "</xsl:text>
    <xsl:for-each select="Group">
      <xsl:apply-templates/>
    </xsl:for-each>
    <xsl:text>"&#10;</xsl:text>
  </xsl:template>
  
</xsl:stylesheet>
"""

SHEET_3 = """<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ft="http://xmlns.4suite.org/ext"
  extension-element-prefixes="ft"
  version="1.0"
  >

  <xsl:output method="text"/>

  <xsl:template match="/">
    <xsl:value-of select="concat('amp &amp; lt &lt; gt &gt; quot &quot; apos ', &quot;&apos;&quot;)"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="ft:escape-xml(concat('amp &amp; lt &lt; gt &gt; quot &quot; apos ', &quot;&apos;&quot;))"/>
  </xsl:template>

</xsl:stylesheet>
"""

SHEET_4 = """<?xml version="1.0"?>
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:ft="http://xmlns.4suite.org/ext"
  extension-element-prefixes="ft"
  version="1.0"
  >

  <xsl:output method="text"/>
  
  <xsl:template match="/">
    <xsl:for-each select="ft:split('1,2,3', ',')">
      <xsl:text>split </xsl:text><xsl:value-of select="."/><xsl:text>&#10;</xsl:text>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>
"""

source_1 = """<dummy/>"""

expected_1 = """Match 1 groups: "a" "1"
Match 1 groups: "b" "2"
Match 1 groups: "c" "3"
"""

expected_2 = """Match 1 groups: "555-1212"
Match 1 groups: "1-800-555-1212"
Match 1 groups: "(612) 555-1313"
"""

expected_3 = """\
amp & lt < gt > quot " apos '
amp &amp; lt &lt; gt &gt; quot " apos '\
"""

EXPECTED_4 = """split 1\nsplit 2\nsplit 3\n"""


def Test(tester):

    source = test_harness.FileInfo(string=source_1)
    sty = test_harness.FileInfo(string=SHEET_1)
    test_harness.XsltTest(tester, source, [sty], expected_1,
                          title="ft:search-re, simple REGEX")


    source = test_harness.FileInfo(string=source_1)
    sty = test_harness.FileInfo(string=SHEET_2)
    test_harness.XsltTest(tester, source, [sty], expected_2,
                          title="ft:search-re, complex REGEX")


    source = test_harness.FileInfo(string=source_1)
    sty = test_harness.FileInfo(string=SHEET_3)
    test_harness.XsltTest(tester, source, [sty], expected_3,
                          title="ft:escape-xml, text output")

    source = test_harness.FileInfo(string=source_1)
    sty = test_harness.FileInfo(string=SHEET_4)
    test_harness.XsltTest(tester, source, [sty], EXPECTED_4,
                          title="ft:split")
    return


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0039 ]--