Testing eXist's XInclude updates
Posted by mholmes on 28 Mar 2007 in Activity log
eXist's XInclude processing was not conformant, and last week Wolfgang posted a message that he'd fixed it. Greg's now built a webapp using the new sources, and we did some testing; the results weren't good, but we may still be doing something wrong. This is what I posted to the eXist list:
We've finally got to a stage where we can test this, and it doesn't seem to be functioning as I expected. These are my sample documents: [xinclude_1.html] <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Testing XInclude (1)</title> </head> <body> <h1 id="doc_title">Testing XInclude (1)</h1> <p>This document is designed to test the functionality of XInclude in eXist.</p> <p>This document should XInclude information from another document. First we have a full document containing only a span tag, identified by href: <xi:include href="xinclude_2.html"><xi:fallback>FAILED TO INCLUDE THE DOCUMENT.</xi:fallback></xi:include> </p> <p>Next, we have a complete paragraph from inside another document, identified with an xpointer:</p> <xi:include href="xinclude_3.html" xpointer="para_to_include"><xi:fallback>FAILED TO INCLUDE THE FRAGMENT.</xi:fallback></xi:include> <p>Finally, we have an attempt to XInclude data from this document -- the text from the h1 tag above. </p> <p><xi:include href="" xpointer="the_title/text()"><xi:fallback>FAILED TO INCLUDE THE LOCAL FRAGMENT.</xi:fallback></xi:include></p> </body></html> [xinclude_2.html] <?xml version="1.0" encoding="UTF-8"?> <span style="font-weight: bold">This is a span tag styled bold.</span> [xinclude_3.html] <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Testing XInclude (3)</title> </head><body> <h1>Testing XInclude (3)</h1> <p id="para_to_include">This is a paragraph containing some stuff which should be xincluded into the calling document.</p> </body></html> As you can see, we're testing three types of XInclude: 1. Including a whole document (in this case consisting of one tag), using this: <xi:include href="xinclude_2.html"><xi:fallback>FAILED TO INCLUDE THE DOCUMENT.</xi:fallback></xi:include> 2. Including a fragment from another file using this: <xi:include href="xinclude_3.html" xpointer="para_to_include"><xi:fallback>FAILED TO INCLUDE THE FRAGMENT.</xi:fallback></xi:include> I've also tried it using this: <xi:include href="xinclude_3.html" xpointer="id(para_to_include)"><xi:fallback>FAILED TO INCLUDE THE FRAGMENT.</xi:fallback></xi:include> 3. Including a fragment from the same file using this: <xi:include href="" xpointer="the_title/text()"><xi:fallback>FAILED TO INCLUDE THE LOCAL FRAGMENT.</xi:fallback></xi:include> Also tried with this: <xi:include href="" xpointer="id(the_title)/text()"><xi:fallback>FAILED TO INCLUDE THE LOCAL FRAGMENT.</xi:fallback></xi:include> We have enable-xinclude set to true. Only the first one succeeds, and even that doesn't succeed fully because it leaves the xi:fallback text in the file; according to my reading of the specification, the xi:fallback tag should be removed if the XInclude operation succeeds. The other two operations fail. I'm testing by retrieving xinclude_1.html from the database in using this in the client app: doc("/db/xinc/xinclude_1.html") Am I missing something here? The eXist build we're using is 1.1.2 dev revision 4311 (shown by the client), and 1.1.2 dev 20070323 (shown by the site).