!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/Borrowed/   drwxr-xr-x
Free 6.78 GB of 27.03 GB (25.06%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     jt_20001117.py (3.42 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#Jeni Tennison <Jeni.Tennison@epistemics.co.uk> taunts her cross-pond mates about politics and the self axis

from Xml.Xslt import test_harness

sheet_1 = """\
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:dem="http://www.democrat.org/"
  xmlns:rep="http://www.republican.org/">

<xsl:template match="vote">
   <xsl:copy>
      <dem:count><xsl:value-of select="rep:count - 432" /></dem:count>
      <xsl:copy-of select="*[not(self::dem:count)]" />
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>"""

source_1 = """<vote xmlns:d="http://www.democrat.org/"
      xmlns:r="http://www.republican.org/">
   <county>Palm Beach</county>
   <d:count>31563</d:count>
   <r:count>23725</r:count>
</vote>"""

expected_1 = """<?xml version='1.0' encoding='UTF-8'?>\n<vote xmlns:d='http://www.democrat.org/' xmlns:r='http://www.republican.org/'><dem:count xmlns:dem='http://www.democrat.org/' xmlns:rep='http://www.republican.org/'>23293</dem:count><county>Palm Beach</county><r:count>23725</r:count></vote>"""

#This version forgets that the principal node type of the self axis is element
sheet_2 = """<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dem="http://www.democrat.org/"
                xmlns:rep="http://www.republican.org/">

<xsl:template match="vote">
   <xsl:copy>
      <xsl:attribute name="dem:count" namespace="http://www.democrat.org/">
        <xsl:value-of select="@rep:count - 432" />
      </xsl:attribute>
      <xsl:copy-of select="@*[not(self::dem:count)]" />
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>"""

source_2 = """<vote xmlns:d="http://www.democrat.org/"
      xmlns:r="http://www.republican.org/"
      county="Palm Beach"
      d:count="31563"
      r:count="23725"/>"""

expected_2 = """<?xml version='1.0' encoding='UTF-8'?>
<vote r:count='23725' county='Palm Beach' d:count='23293' xmlns:d='http://www.democrat.org/' xmlns:r='http://www.republican.org/'/>"""

# The nastiness Jeni resorts to as a general solution to this
sheet_3 = """<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dem="http://www.democrat.org/"
                xmlns:rep="http://www.republican.org/">

<xsl:template match="vote">
   <xsl:copy>
      <xsl:attribute name="dem:count" namespace="http://www.democrat.org/">
        <xsl:value-of select="@rep:count - 432" />
      </xsl:attribute>
      <xsl:copy-of select="@*[not(local-name() = 'count' and namespace-uri() = document('')/*/namespace::dem)]" />
   </xsl:copy>
</xsl:template>

</xsl:stylesheet>"""

expected_3 = """<?xml version='1.0' encoding='UTF-8'?>
<vote r:count='23725' county='Palm Beach' d:count='23293' xmlns:d='http://www.democrat.org/' xmlns:r='http://www.republican.org/'/>"""


def Test(tester):
    source = test_harness.FileInfo(string=source_1)
    sheet = test_harness.FileInfo(string=sheet_1)
    test_harness.XsltTest(tester, source, [sheet], expected_1,
                          title='test 1')

    source = test_harness.FileInfo(string=source_2)
    sheet = test_harness.FileInfo(string=sheet_2)
    test_harness.XsltTest(tester, source, [sheet], expected_2,
                          title='test 2')

    source = test_harness.FileInfo(string=source_2)
    sheet = test_harness.FileInfo(string=sheet_3)
    test_harness.XsltTest(tester, source, [sheet], expected_3,
                          title='test 3')
    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.0035 ]--