# -*- coding: iso-8859-1 -*- #Matt Gushee had problems with xml:lang from Xml.Xslt import test_harness sheet_1 = """\ """ source_1 = """\ Welcome

Welcome

ようこそ


The Kaiwa Club is an informal group for people who want to practice Japanese conversation. We welcome members at all levels of proficiency.

会話倶楽部は日本語の会話を練習したい人のためのインフォーマルなグループで ございます。レベルはかかわらず、新しい会員を大歓迎しております。

""" # NOTE - we need to readd source_2 as a Base64 encoded block # We cannot mix UTF-16 and UTF-8 in the same file source_2 = """\ """ source_3 = """\ Welcome

Welcome


The Kaiwa Club is an informal group for people who want to practice Japanese conversation. We welcome members at all levels of proficiency.

öܸβäͤΤΥեޥʥ롼פ ޤ٥Ϥ餺紿ޤƤޤ

""" #source_1 + sheet_1 with parameter currentLanguage=en saxon_output_1 = """\ Welcome

Welcome


The Kaiwa Club is an informal group for people who want to practice Japanese conversation. We welcome members at all levels of proficiency.

""" #source_1 + sheet_1 with parameter currentLanguage=en # output is xml-ish due to non-null namespace expected_1 = """\n \n Welcome\n \n\n \n

Welcome

\n \n
\n

\nThe Kaiwa Club is an informal group for people who want to practice\nJapanese conversation. We welcome members at all levels of\nproficiency.\n

\n \n \n""" #source_1 + sheet_1 with parameter currentLanguage=ja expected_2 = "" sheet_2 = """\ """ source_4 = """\ Welcome

Welcome

ようこそ


The Kaiwa Club is an informal group for people who want to practice Japanese conversation. We welcome members at all levels of proficiency.

会話倶楽部は日本語の会話を練習したい人のためのインフォーマルなグループで ございます。レベルはかかわらず、新しい会員を大歓迎しております。

""" # NOTE - we need to readd source_5 as a Base64 encoded block # We cannot mix UTF-16 and UTF-8 in the same file source_5 = """\ """ source_6 = """\ Welcome

Welcome


The Kaiwa Club is an informal group for people who want to practice Japanese conversation. We welcome members at all levels of proficiency.

öܸβäͤΤΥեޥʥ롼פ ޤ٥Ϥ餺紿ޤƤޤ

""" expected_3 = """\ """ uche_sheet_1 = """\ """ uche_source_1 = """\ Welcome

Welcome

ようこそ


The Kaiwa Club is an informal group for people who want to practice Japanese conversation. We welcome members at all levels of proficiency.

会話倶楽部は日本語の会話を練習したい人のためのインフォーマルなグループで ございます。レベルはかかわらず、新しい会員を大歓迎しております。

""" # output is xml-ish because of non-null namespace uche_expected_1 = """\n \n Welcome\n \n\n \n

Welcome

\n \n
\n

\nThe Kaiwa Club is an informal group for people who want to practice\nJapanese conversation. We welcome members at all levels of\nproficiency.\n

\n \n \n""" uche_expected_2 = """\

ようこそ


会話倶楽部は日本語の会話を練習したい人のためのインフォーマルなグループで ございます。レベルはかかわらず、新しい会員を大歓迎しております。

""" 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, topLevelParams={'currentLanguage' : 'en'}, title='Selector sheet 1, source 1, lang=en') source = test_harness.FileInfo(string=source_1) sheet = test_harness.FileInfo(string=sheet_1) test_harness.XsltTest(tester, source, [sheet], expected_2, topLevelParams={'currentLanguage' : 'ja'}, title='Selector sheet 1, source 1, lang=ja') source = test_harness.FileInfo(string=uche_source_1) sheet = test_harness.FileInfo(string=uche_sheet_1) test_harness.XsltTest(tester, source, [sheet], uche_expected_1, topLevelParams={'currentLanguage' : 'en'}, title="Uche's selector sheet 1, source 1, lang=en") # Don't run until we can try on Matt's console to avoid terminal corruption ## source = test_harness.FileInfo(string=uche_source_1) ## sheet = test_harness.FileInfo(string=uche_sheet_1) ## test_harness.XsltTest(tester, source, [sheet], uche_expected_2, ## topLevelParams={'currentLanguage' : 'ja'}) ## title="Uche's selector sheet 1, source 1, lang=ja") return