#Jason Diamond's tool for converting RDF to a normalized XML serilization #See http://lists.w3.org/Archives/Public/www-rdf-interest/2000Sep/0097.html from Xml.Xslt import test_harness source_1 = """ JavaWorld http://www.javaworld.com Add JavaWorld to your My Netscape page! The JavaWorld channel lets you stay on top of the latest developer tips, tutorials, news, and resources offered by JavaWorld. JavaWorld Logo http://www.javaworld.com/icons/jw-mynetscape.gif http://www.javaworld.com "Streaming JavaWorld" -- the streaming audio news and talk for Java project managers http://www.javaworld.com/common/jw-streaming.html?myns Streaming JavaWord: An audio program for Java project managers and programmers http://www.javaworld.com/common/jw-streaming.html?myns Programming Java Devices: An Overview http://www.javaworld.com/jw-07-1999/jw-07-device.html?myns GO! Search JavaWorld col=jw&qt http://search.javaworld.com/query.html """ source_2 = """\ """ expected_1 = """ anonymous:id1 http://my.netscape.com/rdf/simple/0.9/title JavaWorld anonymous:id1 http://my.netscape.com/rdf/simple/0.9/link http://www.javaworld.com anonymous:id1 http://my.netscape.com/rdf/simple/0.9/description Add JavaWorld to your My Netscape page! The JavaWorld channel lets you stay on top of the latest developer tips, tutorials, news, and resources offered by JavaWorld. anonymous:id2 http://my.netscape.com/rdf/simple/0.9/title JavaWorld Logo anonymous:id2 http://my.netscape.com/rdf/simple/0.9/url http://www.javaworld.com/icons/jw-mynetscape.gif anonymous:id2 http://my.netscape.com/rdf/simple/0.9/link http://www.javaworld.com anonymous:id3 http://my.netscape.com/rdf/simple/0.9/title "Streaming JavaWorld" -- the streaming audio news and talk for Java project managers anonymous:id3 http://my.netscape.com/rdf/simple/0.9/link http://www.javaworld.com/common/jw-streaming.html?myns anonymous:id4 http://my.netscape.com/rdf/simple/0.9/title Streaming JavaWord: An audio program for Java project managers and programmers anonymous:id4 http://my.netscape.com/rdf/simple/0.9/link http://www.javaworld.com/common/jw-streaming.html?myns anonymous:id5 http://my.netscape.com/rdf/simple/0.9/title Programming Java Devices: An Overview anonymous:id5 http://my.netscape.com/rdf/simple/0.9/link http://www.javaworld.com/jw-07-1999/jw-07-device.html?myns anonymous:id6 http://my.netscape.com/rdf/simple/0.9/title GO! anonymous:id6 http://my.netscape.com/rdf/simple/0.9/description Search JavaWorld anonymous:id6 http://my.netscape.com/rdf/simple/0.9/name col=jw&qt anonymous:id6 http://my.netscape.com/rdf/simple/0.9/link http://search.javaworld.com/query.html """ expected_2 = """ anonymous:id1 http://www.w3.org/1999/02/22-rdf-syntax-ns#li http://foo.org/foo.html anonymous:id1 http://www.w3.org/1999/02/22-rdf-syntax-ns#li http://bar.org/bar.html """ # " def Test(tester): source = test_harness.FileInfo(string=source_1) sheet = test_harness.FileInfo(uri='Xml/Xslt/Borrowed/rdftripledump.xslt') test_harness.XsltTest(tester, source, [sheet], expected_1) source = test_harness.FileInfo(string=source_2) sheet = test_harness.FileInfo(uri='Xml/Xslt/Borrowed/rdftripledump.xslt') test_harness.XsltTest(tester, source, [sheet], expected_2) return