<< APPENDIX_E_Footprint

Index of HTML Docs

APPENDIX_G_StoreSpeed >>

 

 

 

APPENDIX F

TEST 2: FLATTENING ACCURACY

 

Group A:  Child Elements

Group B: Streamed XML

Group C:  Comments

Group D: DOCTYPE Declarations

Group E: Processing instructions

Group F: Mixed Content

Group G: CDATA

Group H: Entity References

Group I: XML Declaration

Group J: White space

 

 

Note that in most relevant cases, we have left out comments about whitespace. See the discussion of whitespace in Chapter 8.

 

 

Group A:  Child Elements

 

Document A1:     <Name><Last>Wenker</Last><First>Ken</First></Name>

Response A1:     <Query-Results>

                 <Name>

                     <Last>Wenker</Last>

                     <First>Ken</First>

                 </Name>

             </Query-Results>

Comments A1:    OK.

 

Document A2:  <Name>

                 <Last>Wenker</Last>

                 <First>Ken</First>

             </Name>

Response A2:  <Query-Results>

                 <Name>

                     <Last>Wenker</Last>

                     <First>Ken</First>

                 </Name>

             </Query-Results>

Comments A2:    OK.

 

Top of Appendix F

 

Group B: Streamed XML

 

Document B1:     <CATALOG><CD ID="8"><TITLE>Empire Burlesque</TITLE><ARTIST>Bob Dylan</ARTIST><COUNTRY>USA</COUNTRY><COMPANY>Columbia</COMPANY><PRICE>10.90</PRICE><YEAR>1985</YEAR></CD><CD ID="2"><TITLE>Stop</TITLE><ARTIST>Sam Brown</ARTIST><COUNTRY>UK</COUNTRY><COMPANY>A and M</COMPANY><PRICE>8.90</PRICE><YEAR>1988</YEAR></CD><CD ID="5"><TITLE>The dock of the bay</TITLE><ARTIST>Otis Redding</ARTIST><COUNTRY>USA</COUNTRY><COMPANY>Atlantic</COMPANY><PRICE>7.90</PRICE><YEAR>1987</YEAR></CD></CATALOG>

Response B1:   <Query-Results>

                 <CATALOG>

                     <CD ID="8">

                         <TITLE>Empire Burlesque</TITLE>

                         <ARTIST>Bob Dylan</ARTIST>

                         <COUNTRY>USA</COUNTRY>

                         <COMPANY>Columbia</COMPANY>

                         <PRICE>10.90</PRICE>

                         <YEAR>1985</YEAR>

                     </CD>

                     <CD ID="2">

                         <TITLE>Stop</TITLE>

                         <ARTIST>Sam Brown</ARTIST>

                         <COUNTRY>UK</COUNTRY>

                         <COMPANY>A and M</COMPANY>

                         <PRICE>8.90</PRICE>

                         <YEAR>1988</YEAR>

                     </CD>

                     <CD ID="5">

                         <TITLE>The dock of the bay</TITLE>

                         <ARTIST>Otis Redding</ARTIST>

                         <COUNTRY>USA</COUNTRY>

                         <COMPANY>Atlantic</COMPANY>

                         <PRICE>7.90</PRICE>

                         <YEAR>1987</YEAR>

                     </CD>

                 </CATALOG>

             </Query-Results>

Comments B1:    OK.

 

Top of Appendix F

 

 

Group C:  Comments

 

Document C1:     <!-- a comment -->

             <A>test text</A>

Response C1:   <Query-Results>

                 <A>test text</A>

             </Query-Results>

Comments C1:    NeoCore does return some materials outside the root element, such as DOCTYPE declarations as in Group D below. So, it is at least possible to also return comments which are outside the root element. Further, NeoCore in general does retain comments, as in Documents 2, 3, and 4 of this group. It is reasonable to argue that for consistency, the comment in Document C1 should be retained. This should not be interpreted as an architectural problem but  merely as an implementation oversight which is likely to be corrected in future releases.

 

Document C2:   <A>test<!-- a comment --> text</A>

Response C2:   <Query-Results>

                 <A>

                     test

                     <!-- a comment  -->

                     text

                 </A>

             </Query-Results>

Comments C2:    OK

 

Document C3:  <A>test text</A><!-- a comment -->

Response C3:  <Query-Results>

                 <A>test text</A>

                 <!-- a comment  -->

             </Query-Results>

Comments C3: OK

 

Document C4:  <A>

                 <B>test text</B><!-- a comment -->

             </A>

Response C4:  <Query-Results>

                 <A>

                     <B>test text</B>

                     <!-- a comment  -->

                 </A>

             </Query-Results>

Comments C4:    OK.

 

Top of Appendix F

 

 

Group D: DOCTYPE Declarations

 

Document D1:  <!DOCTYPE A SYSTEM "file://localhost/c|temp/A.DTD">

             <A />

Response D1:  <Query-Results>

                 <A></A>

                              </Query-Results>

Comments D1: 

     (a) C:\temp\A.DTD contains:  “<!ELEMENT A (#PCDATA)>”.

            (b) See discussion of this query in Chapter 8.

            (c) See also Document H1, below.

 

Document D2:  <!DOCTYPE A [

             <!ELEMENT A (#PCDATA)>

             ]>

             <A />

Response D2:  <Query-Results>

                 <prolog>&lt;!DOCTYPE A [

                $lt;!ELEMENT A (#PCDATA)&gt;

             ]&gt;</prolog>

                 <A></A>

             </Query-Results>

Comments D2:    See discussion of this query in Chapter 8.

 

Top of Appendix F

 

 

Group E: Processing instructions

 

Document E1:  <A>

                 <?foo bar?>

             </A>

Response E1:  <Query-Results>

                 <A>

                     <?foo bar ?>

                 </A>

             </Query-Results>

Comments E1:    OK

 

Document E2:  <?foo bar?>

             <A>

             </A>

Response E2:  <Query-Results>

                 <?foo bar ?>

                 <A></A>

             </Query-Results>

Comments E2:    OK

 

Document E3:  <A>

             </A>

             <?foo bar?>

Response E3:  <Query-Results>

                 <A></A>

                 <?foo bar ?>

             </Query-Results>

Comments E3:    OK.

 

Document E4:  <A>

                 asdfasdf <?foo bar?> fdsafdsa

             </A>

Response E4:  <Query-Results>

                 <A>

                     asdfasdf

                     <?foo bar ?>

                     fdsafdsa

                 </A>

             </Query-Results>

Comments E4:    OK.

 

Document E5:  <A><?foo?></A>

Response E5:  <Query-Results>

                 <A>

                     <?foo  ?>

                 </A>

             </Query-Results>

Comments E5:    OK.

 

Top of Appendix F

 

 

Group F: Mixed Content

 

Document F1:  <p>This is my example of <b>a bold tag</b> inside text</p>

Response F1:  <Query-Results>

                 <p>

                     This is my example of

                     <b>a bold tag</b>

                     inside text

                 </p>

             </Query-Results>

Comments F1:    OK.

 

Document F2:  <p>Here is a <p>more complex<p> example<p> that would upset</p>    most</p> HTML </p> browsers.</p>

Response F2:  <Query-Results>

                 <p>

                     Here is a

                     <p>

                         more complex

                         <p>

                             example

                             <p>that would upset</p>

                             most

                         </p>

                         HTML

                     </p>

                     browsers.

                 </p>

             </Query-Results>

Comments F2:    The initial document, here wrapped, was on a single line.

 

Top of Appendix F

 

 

Group G: CDATA

 

Document G1:  <p>Here is a <![CDATA[simple CDATA section]]>.</p>

Response G1:  <Query-Results>

                 <p>

                     Here is a

                     <![CDATA[ simple CDATA section]]>

                     .

                 </p>

             </Query-Results>

Comments G1:    OK.

 

Document G2:  <p>Here is a more useful CDATA section, showing why you might      actually want to use one:

             <br /><br />

             The following elements:

             <br /><br />

             <![CDATA[<b>bold</b>]]>

             <br /><br />

             cause the word "bold" to be printed in <b>bold</b>.</p>

Response G2:  <Query-Results>

                 <p>

                     Here is a more useful CDATA section, showing why you might actually want to use one:

                     <br></br>

                     <br></br>

                     The following elements:

                     <br></br>

                     <br></br>

                     <![CDATA[ <b>bold</b>]]>

                     <br></br>

                     <br></br>

                     cause the word "bold" to be printed in

                     <b>bold</b>

                     .

                 </p>

             </Query-Results>

>

Comments G2:    In the original document the long text line, wrapped here, was a single line. In the response, the wrapping shown here was forced.

 

Document G3:  <p>Yet another more complex <![CDATA[&foo;]]> section.</p>

Response G3:  <Query-Results>

                 <p>

                     Yet another more complex

                     <![CDATA[&foo;]]>

                     section.

                 </p>

             </Query-Results>

Comments G3:    OK.

 

Top of Appendix F

 

 

Group H: Entity References

 

Document H1:  <!DOCTYPE A SYSTEM "file://localhost/c|temp/B.DTD">

             <A>&foo;</A>

Response H1:  <Query-Results>

                 <A>&foo;</A>

             </Query-Results>

Comments H1:

            (a) File C:\temp\B.DTD contains: “<!ENTITY foo “bar”>

            (b) Because the DOCTYPE reference was dropped on the reply, the NeoCore Console, which uses the XML parser from the client’s browser, would not display the response. The response shown is the API response.

            (c) See the discussion of Query D2, in Chapter 8.

 

Document H2:  <!DOCTYPE A[

                 <!ENTITY foo "bar">

             ]>

             <A>&foo;</A>

Response H2:  <Query-Results>

                 <prolog>&lt;!DOCTYPE A [

                &lt;!ENTITY foo &quot;bar&quot;&gt;

             ]&gt;</prolog>

                 <A>bar</A>

             </Query-Results>

Comments H2:    See discussion of “Entity References” in Chapter 8.

 

Document H3:  <A>&amp;</A>

Response H3:  <Query-Results>

                 <A>&amp;</A>

             </Query-Results>

Comments H3:    See discussion of “Entity References” in Chapter 8.

 

Document H4:  <A>&amp;amp;</A>

Response H4:  <Query-Results>

                 <A>&amp;amp;</A>

             </Query-Results>

Comments H4:    See discussion of “Entity References” in Chapter 8.

 

Top of Appendix F

 

 

Group I: XML Declaration

 

Document I1:    <?xml version="1.0" encoding="UTF-8" ?>

             <A>test text</A>

Response I1:   <Query-Results>

                 <A>test text</A>

             </Query-Results>

Comments I1:      The XML declaration is optional. However, given the NeoCore architecture, it would be easy for NeoCore to store and retrieve the XML declaration when asked. Why not do so?

 

Document I2:       <?xml version="4.0" encoding="UTF-8" ?>

                 <A>test text</A>

Response I2:   <Query-Results>

                 <A>test text</A>

             </Query-Results>

Comments I2:      Apparently NeoCore has not been paying attention at all to the contents of the XML declaration; in the past there has been no need to. But now there is a version 1.1 appearing, and NeoCore will have to begin paying attention. This document really should be rejected.

 

Top of Appendix F

 

 

Group J: White space

 

Document J1:      <A>Dear Friend:

            

             There is an extra line-space before the body of this letter.

            

             Sincerely,

            

             Ken</A>

Response J1:   <Query-Results>

                 <A>Dear Friend:

 

             There is an extra line-space before the      body of this letter.

 

             Sincerely,

 

             Ken</A>

             </Query-Results>

Comments J1:     OK

 

Document J2:   <A>           a           a           </A>

Response J2:   <Query-Results>

                 <A>a            a</A>

             </Query-Results>

Comments J2:    

(1)         There are 11 spaces between the ‘a’ characters in both query and response.

(2)         Also, note that when doing the query, if you ask for any spaces between the ‘<A>’ and the ‘a’ you will get a null reply. In other words, the document is being stored as shown in the response; it is not merely that the response is displaying that way.

 

Document J3:   <!-- this uses tabs instead of multiple spaces -->

             <A> a   a   </A>

Response J3:   <Query-Results>

                 <A>a        a</A>

             </Query-Results>

Comments J3:     Both the document and the response have a single tab between the ‘a’ characters. The document also has a tab character before and after the two ‘a’ characters.

 

Document J4:      <A>         a           a               </>

Response J4:      <Query-Results>

                 <A>a                a</A>

             </Query-Results>

Comments J4:     The relevant white space is three tab characters in both document and response.

 

Document J5:      <A>   </A>

Response J5:   <Query-Results>

                 <A><A />

                              </Query-Results>

Comments J5:    There are three spaces in the original document.

 

Top of Appendix F

 

 

<< APPENDIX_E_Footprint

Index of HTML Docs

APPENDIX_G_StoreSpeed >>