File: test_content_structure.kid

package info (click to toggle)
kid 0.9.6-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 2,264 kB
  • ctags: 4,633
  • sloc: python: 7,417; makefile: 120; sh: 47; xml: 4
file content (35 lines) | stat: -rw-r--r-- 859 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version='1.0' encoding='utf-8'?>
<?python #
from os.path import dirname, join as joinpath

some_xml = "<hello>world</hello>"

from kid import Element, SubElement
test_elm = Element("elmo")
test_elm.set("oscar", "grouch")
SubElement(test_elm, "inner").text = "test"

?>
<testdoc xmlns:py="http://purl.org/kid/ns#">
  <test>
    <attempt py:content="document(joinpath(dirname(__file__), 'include-me.xml'))">
      test including a file
    </attempt>
    <expect><div>
  <p>included from external file.</p>
  <p>cool</p>
</div></expect>
  </test>
  <test>
    <attempt py:content="XML(some_xml)">
      test with XML string
    </attempt>
    <expect><hello>world</hello></expect>
  </test>

  <test>
    <attempt py:content="test_elm">Test Element type</attempt>
    <expect><elmo oscar="grouch"><inner>test</inner></elmo></expect>
  </test>

</testdoc>