!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.89 GB of 27.03 GB (18.11%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_handler_override.py (3.87 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#Test the overidding of the processor handlers
#This will also test baseUri resolution for includes, imports and documents (some see test_baseUris for more testing)

from Xml.Xslt import test_harness

import urlparse, cStringIO
from Ft.Lib import Uri
from Ft.Xml import InputSource

doc1 = """<?xml version='1.0' encoding='UTF-8'?>
<root>DOC1</root>"""

doc2 = """<?xml version='1.0' encoding='UTF-8'?>
<root>DOC2</root>"""

style1 = """<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
  <xsl:template match='/root'>
    <xsl:text>STY1</xsl:text>
    <xsl:value-of select='.'/>
  </xsl:template>
</xsl:stylesheet>"""

style2 = """<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
  <xsl:include href='STY1'/>
  <xsl:template match='/root'>
    <xsl:text>STY2</xsl:text>
    <xsl:value-of select='.'/>
  </xsl:template>
</xsl:stylesheet>"""

style3 = """<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
  <xsl:import href='STY1'/>
  <xsl:template match='/root'>
    <xsl:text>STY3</xsl:text>
    <xsl:value-of select='.'/>
  </xsl:template>
</xsl:stylesheet>"""

style4 = """<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
  <xsl:template match='/root'>
    <xsl:text>STY4</xsl:text>
    <xsl:value-of select='document("DOC2")/root'/>
  </xsl:template>
</xsl:stylesheet>"""

BASE_URI = "http://foo.com/"

URIS={BASE_URI + 'DOC1' : doc1,
      BASE_URI + 'DOC2' : doc2,
      BASE_URI + 'STY1' : style1,
      BASE_URI + 'STY2' : style2,
      BASE_URI + 'STY3' : style3,
      BASE_URI + 'STY4' : style4,
      }


class GenericInputSource(InputSource.InputSource):

    def _openStream(self, uri, ignoreErrors=0):
        scheme = urlparse.urlparse(uri)[0]
        #if scheme in ['', 'http', 'ftp', 'file', 'gopher']:
        #    raise uri
        st = URIS[uri]
        return cStringIO.StringIO(st)

InputSourceFactory = InputSource.InputSourceFactory(GenericInputSource)


DOC1_STY1_EXPECTED="""<?xml version="1.0" encoding="UTF-8"?>
STY1DOC1"""

DOC1_STY2_EXPECTED="""<?xml version="1.0" encoding="UTF-8"?>
STY2DOC1"""

DOC1_STY3_EXPECTED="""<?xml version="1.0" encoding="UTF-8"?>
STY3DOC1"""

DOC1_STY4_EXPECTED="""<?xml version="1.0" encoding="UTF-8"?>
STY4DOC2"""


def Test(tester):
    source = test_harness.FileInfo(uri=BASE_URI+'DOC1')
    sty = test_harness.FileInfo(uri=BASE_URI+'STY1')
    test_harness.XsltTest(tester, source, [sty], DOC1_STY1_EXPECTED,
                          documentInputFactory=InputSourceFactory,
                          stylesheetInputFactory=InputSourceFactory,
                          title='Simple URI')


    source = test_harness.FileInfo(uri=BASE_URI+'DOC1')
    sty = test_harness.FileInfo(uri=BASE_URI+'STY2')
    test_harness.XsltTest(tester, source, [sty], DOC1_STY2_EXPECTED,
                          documentInputFactory=InputSourceFactory,
                          stylesheetInputFactory=InputSourceFactory,
                          title='Relative URI included')


    source = test_harness.FileInfo(uri=BASE_URI+'DOC1')
    sty = test_harness.FileInfo(uri=BASE_URI+'STY3')
    test_harness.XsltTest(tester, source, [sty], DOC1_STY3_EXPECTED,
                          documentInputFactory=InputSourceFactory,
                          stylesheetInputFactory=InputSourceFactory,
                          title='Relative URI imported')


    source = test_harness.FileInfo(uri=BASE_URI+'DOC1')
    sty = test_harness.FileInfo(uri=BASE_URI+'STY4')
    test_harness.XsltTest(tester, source, [sty], DOC1_STY4_EXPECTED,
                          documentInputFactory=InputSourceFactory,
                          stylesheetInputFactory=InputSourceFactory,
                          title='Relative URI document')
    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.004 ]--