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


Viewing file:     ml_20000128.py (1.32 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#Markus Lauer's message:
"""
does XPath work with html Documents? In the below code in the result of
the XPath evaluation the <H1>...</H1> node is missing.

Do I use XPath in a wrong way? Is it a bug? Is XPath not supposed
to work with HTML files?

I tried this with 4Dom-0.9.2, XPath-0.8.2 and 4Suite-base-0.7.1
Python 1.5.2 under SuSE Linux 6.3

(by the way: the hole 4Suite compiled without any problems out of the box)
"""

from Ft.Xml.Domlette import Print
import Ft.Xml.XPath
from Ft.Xml.XPath import Evaluate, Context
import sys, cStringIO

html="""
<HTML>
<HEAD><TITLE>foo</TITLE>
<TITLE>foo</TITLE>
</HEAD>
<BODY>
<H1>foo</H1>
</BODY>
</HTML>
"""

expected_1 = """<HEAD><TITLE>foo</TITLE>
<TITLE>foo</TITLE>
</HEAD>"""

#"

try:
    from xml.dom.ext.reader import HtmlLib
except ImportError:
    HtmlLib = None

def Test(tester):

    tester.startTest("Evaluate on a HTML Document")

    if HtmlLib is None:
        tester.warning("Requires PyXML to be installed")
        tester.testDone()
        return

    xml_dom = HtmlLib.FromHtml(html)

    p = Ft.Xml.XPath.parser.new()
    exp = p.parse("/HTML/HEAD")

    c=Context.Context(xml_dom,0,0)
    result=exp.evaluate(c)

    
    st = cStringIO.StringIO()
    Print(result[0],st)
    tester.compare(expected_1,st.getvalue())

    tester.testDone()

if __name__ == '__main__':
    test()


:: 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 ]--