Beispiel #1
0
 def test_xml(self):
     self.assertTrue(
         util.looks_like_xml(
             '<?xml ?><!DOCTYPE html PUBLIC  "-//W3C//DTD XHTML 1.0 Strict//EN">'
         ))
     self.assertTrue(util.looks_like_xml('<html xmlns>abc</html>'))
     self.assertFalse(util.looks_like_xml('<html>'))
Beispiel #2
0
 def analyse_text(text):
     rv = JavaLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     if '<%' in text and '%>' in text:
         rv += 0.1
     return rv
Beispiel #3
0
 def analyse_text(text):
     rv = JavaLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     if '<%' in text and '%>' in text:
         rv += 0.1
     return rv
Beispiel #4
0
 def analyse_text(text):
     rv = TeaLangLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     if "<%" in text and "%>" in text:
         rv += 0.1
     return rv
Beispiel #5
0
 def analyse_text(text):
     rv = 0.0
     if re.search("val \w+\s*:", text):
         rv += 0.6
     if looks_like_xml(text):
         rv += 0.2
     if "<%" in text and "%>" in text:
         rv += 0.1
     return rv
 def analyse_text(text):
     if not looks_like_xml(text) and \
        ('<!ELEMENT' in text or '<!ATTLIST' in text or '<!ENTITY' in text):
         return 0.8
Beispiel #7
0
 def test_xml(self):
     self.assert_(util.looks_like_xml(
         '<?xml ?><!DOCTYPE html PUBLIC  "-//W3C//DTD XHTML 1.0 Strict//EN">'))
     self.assert_(util.looks_like_xml('<html xmlns>abc</html>'))
     self.failIf(util.looks_like_xml('<html>'))
Beispiel #8
0
 def analyse_text(text):
     if looks_like_xml(text):
         return 0.5
Beispiel #9
0
Datei: html.py Projekt: axil/blog
 def analyse_text(text):
     if looks_like_xml(text) and '<xsl' in text:
         return 0.8
Beispiel #10
0
 def test_xml(self):
     self.assertTrue(util.looks_like_xml('<?xml ?><!DOCTYPE html PUBLIC  "-//W3C//DTD XHTML 1.0 Strict//EN">'))
     self.assertTrue(util.looks_like_xml("<html xmlns>abc</html>"))
     self.assertFalse(util.looks_like_xml("<html>"))
def test_xml():
    assert util.looks_like_xml(
        '<?xml ?><!DOCTYPE html PUBLIC  "-//W3C//DTD XHTML 1.0 Strict//EN">')
    assert util.looks_like_xml('<html xmlns>abc</html>')
    assert not util.looks_like_xml('<html>')
Beispiel #12
0
 def analyse_text(text):
     if looks_like_xml(text):
         return 0.5
Beispiel #13
0
 def analyse_text(text):
     rv = PhpLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     return rv
Beispiel #14
0
 def analyse_text(text):
     rv = VelocityLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.5
     return rv
 def analyse_text(text):
     if looks_like_xml(text):
         return 0.45  # less than HTML
Beispiel #16
0
Datei: html.py Projekt: axil/blog
 def analyse_text(text):
     if not looks_like_xml(text) and \
        ('<!ELEMENT' in text or '<!ATTLIST' in text or '<!ENTITY' in text):
         return 0.8
 def analyse_text(text):
     if looks_like_xml(text) and '<xsl' in text:
         return 0.8
Beispiel #18
0
Datei: html.py Projekt: axil/blog
 def analyse_text(text):
     if looks_like_xml(text):
         return 0.45  # less than HTML
Beispiel #19
0
 def analyse_text(text):
     rv = PhpLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.4
     return rv
Beispiel #20
0
 def analyse_text(text):
     rv = VelocityLexer.analyse_text(text) - 0.01
     if looks_like_xml(text):
         rv += 0.5
     return rv