# At the time of this writing,
# 4XSLT generates a traceback when you do an apply-templates on a result tree
# fragment. It should generate a friendly (but equally fatal) error.
#
from Xml.Xslt import test_harness
sheet_1 = """\
Processing the root node of the fragment.
Processing the 'myElement' node of the fragment.
This element has
ancestor(s).
"""
expected_1 = """\
Processing the root node of the fragment. hello world
Processing the 'myElement' node of the fragment.
This element has 1 ancestor(s).
"""
sheet_2 = """\
Processing the 'myElement' node of the fragment.
"""
expected_2 = """\
Processing the 'myElement' node of the fragment.
"""
def Test(tester):
source = test_harness.FileInfo(string=sheet_1)
sheet = test_harness.FileInfo(string=sheet_1)
test_harness.XsltTest(tester, source, [sheet], expected_1,
title='Case 1')
source = test_harness.FileInfo(string=sheet_2)
sheet = test_harness.FileInfo(string=sheet_2)
test_harness.XsltTest(tester, source, [sheet], expected_2,
title='Case 2')
return