pike.git / lib / modules / Parser.pmod / XML.pmod / testsuite.in

version» Context lines:

pike.git/lib/modules/Parser.pmod/XML.pmod/testsuite.in:64:    " <category example:test='yes' label='Test' example:test='yes' term='test' />\n"    " </entry>\n"    "</feed>")->render_xml();   ]], "<feed xmlns='http://www.w3.org/2005/Atom'"    " xmlns:example='http://www.example.com/example'>\n"    " <entry>\n"    " <category example:test='yes' label='Test' term='test'/>\n"    " </entry>\n"    "</feed>")    + test_do([[ +  add_constant("xmlblob", + #"<?xml version='1.0' encoding='utf-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:A='http://example.com/dtd'> +  <generator>Grubba</generator> +  <id>urn:uuid:4baeaeb4-7125-463a-9b68-a7005a7548bb</id> +  <title>Namespace Test</title> +  <updated>2012-09-28T16:02:16+02:00</updated> +  <entry> +  <title>Namespace Test</title> +  <id>urn:uuid:e73d603c-c287-47c8-b17c-c9e35981d64a</id> +  <link href='urn:uuid:e73d603c-c287-47c8-b17c-c9e35981d64a' rel='self'/> +  <updated>2012-09-28T16:02:16+02:00</updated> +  <author> +  <name>Grubba</name> +  </author> +  <A:user user-name='grubba'>Grubba</A:user> +  <category A:example='yes' A:priority='300' scheme='http://example.com/dtd' term='example'/> +  <A:a> +  <A:b date='2010-10-01'> +  <A:c yes='no'/> +  </A:b> +  </A:a> +  <content type='xhtml'> +  <div xmlns='http://www.w3.org/1999/xhtml'> +  <div A:id='1' class='text' id='e73ab900-f76d-41f7-8576-6be10519e31b' name='text'> +  <h1 class='headline'>Namespace Test</h1> +  <p class='normal'>This is a test of whether namespaces work in Parser.XML.Tree.</p> +  </div> +  <div class='image' id='68788699-d986-418a-8ca2-2a058ab86625' name='image'> +  <img class='image' src='/some/path/to/an/image.jpg'/> +  </div> +  </div> +  </content> +  </entry> + </feed>"); + ]]) +  + test_eq([[Parser.XML.Tree.simple_parse_input(xmlblob)->render_xml()]], xmlblob) + test_eq([[Parser.XML.Tree.simple_parse_input(xmlblob, UNDEFINED, +  Parser.XML.Tree.PARSE_ENABLE_NAMESPACES)->render_xml()]], xmlblob) +  + test_do([[add_constant("xmlblob");]]) +    // NSTree      // XML NS section 2      test_any_equal([[   object x=Parser.XML.NSTree.parse_input(#"   <x>    <!-- No namespace here. -->   </x>");   x=x[0];