Nicolae Brinza has proposed merging lp:~nbrinza/zorba/parse-fragment into 
lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)

For more details, see:
https://code.launchpad.net/~nbrinza/zorba/parse-fragment/+merge/115377

The parse-fragment function now allows a DOCTYPE declaration in the input.
-- 
https://code.launchpad.net/~nbrinza/zorba/parse-fragment/+merge/115377
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-07-12 17:29:55 +0000
+++ ChangeLog	2012-07-17 15:50:41 +0000
@@ -4,6 +4,8 @@
 version 2.x
 
 New Features:
+  * The parse-fragment function now allows a DOCTYPE declaration in the input.
+    (Also fixed bug #1016606 with the feature request). 
   * Implemented the new EQName syntax (use Q{namespace}local instead of "namespace":local).
     Also updated the fn:path() function.
   * Item::isSeekable API extension for streamable content (xs:string and xs:base64Binary).
@@ -30,6 +32,7 @@
   * Streaming execution for tumbling windows (also fixes bug #1010051).
 
 Bug Fixes/Other Changes:
+  * Fixed bug #1016606 (DOCTYPE in the input of the parse-fragment function)
   * Fixed bug #1002993 (bug during revalidation after update; improper condition
     for calling TypeOps::get_atomic_type_code() from
     SchemaValidatorImpl::isPossibleSimpleContentRevalImpl())

=== modified file 'modules/com/zorba-xquery/www/modules/xml-options.xsd'
--- modules/com/zorba-xquery/www/modules/xml-options.xsd	2012-07-12 17:29:55 +0000
+++ modules/com/zorba-xquery/www/modules/xml-options.xsd	2012-07-17 15:50:41 +0000
@@ -61,6 +61,7 @@
               </simpleType>
             </attribute>            
             <attribute name="skip-top-level-text-nodes" type="boolean" use="optional"/>
+            <attribute name="error-on-doctype" type="boolean" use="optional"/>
           </complexType>
         </element>
         <element name="substitute-entities" minOccurs="0" maxOccurs="1">

=== modified file 'modules/com/zorba-xquery/www/modules/xml.xq'
--- modules/com/zorba-xquery/www/modules/xml.xq	2012-07-12 17:29:55 +0000
+++ modules/com/zorba-xquery/www/modules/xml.xq	2012-07-17 15:50:41 +0000
@@ -141,7 +141,11 @@
  : external entities. If the option 
  : is enabled, the input must conform to the syntax extParsedEnt (production 
  : [78] in XML 1.0, see <a href="http://www.w3.org/TR/xml/#wf-entities";>
- : Well-Formed Parsed Entities</a>). The result of the function call is a list 
+ : Well-Formed Parsed Entities</a>). In addition, by default a DOCTYPE declaration is allowed,
+ : as described by the [28] doctypedecl production, see <a href="http://www.w3.org/TR/xml/#NT-doctypedecl";>
+ : Document Type Definition</a>. A parameter is available to forbid the appearance of the DOCTYPE.
+ :
+ : The result of the function call is a list 
  : of nodes corresponding to the top-level components of the content of the 
  : external entity: that is, elements, processing instructions, comments, and 
  : text nodes. CDATA sections and character references are expanded, and 
@@ -151,7 +155,7 @@
  : (<a href="http://www.w3.org/TR/xml/#sec-well-formed";>production [1] in XML 1.0</a>).
  : This option can not be used together with either the &lt;schema-validate/&gt; or the &lt;DTD-validate/&gt;
  : option. Doing so will raise a zerr:ZXQD0003 error.
- : The &lt;parse-external-parsed-entity/&gt; option has two parameters, given by attributes. The first
+ : The &lt;parse-external-parsed-entity/&gt; option has three parameters, given by attributes. The first
  : attribute is "skip-root-nodes" and it can have a non-negative value. Specifying the paramter
  : tells the parser to skip the given number of root nodes and return only their children. E.g.
  : skip-root-nodes="1" is equivalent to parse-xml($xml-string)/node()/node() . skip-root-nodes="2" is equivalent
@@ -159,7 +163,8 @@
  : boolean value. Specifying "true" will tell the parser to skip top level text nodes, returning
  : only the top level elements, comments, PIs, etc. This parameter works in combination with
  : the "skip-root-nodes" paramter, thus top level text nodes are skipped after "skip-root-nodes" has 
- : been applied. 
+ : been applied. The third paramter is "error-on-doctype" and will generate an error if a DOCTYPE
+ : declaration appears in the input, which by default is allowed.
  : </li>
  :
  : <li>

=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml	2012-07-12 17:29:55 +0000
+++ src/diagnostics/diagnostic_en.xml	2012-07-17 15:50:41 +0000
@@ -3834,7 +3834,15 @@
     </entry>
     
     <entry key="ParseFragmentInvalidOptions">
-      <value>invalid options passed to the parse-xml:parse() function, the element must in the schema target namespace</value>
+      <value>invalid options passed to the parse-xml:parse() function, the element must be in the schema target namespace</value>
+    </entry>
+    
+    <entry key="ParseFragmentDoctypeNotAllowed">
+      <value>a DOCTYPE declaration is not allowed</value>
+    </entry>
+    
+    <entry key="ParseFragmentDoctypeNotAllowedHere">
+      <value>a DOCTYPE declaration must appear before any element or text node, and at most once</value>
     </entry>
     
     <entry key="FormatNumberDuplicates">

=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp	2012-07-12 17:29:55 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp	2012-07-17 15:50:41 +0000
@@ -670,7 +670,9 @@
   { "~OpNodeBeforeMustHaveNodes", "op:node-before() must have nodes as parameters" },
   { "~OperationNotDef_23", "$2 not defined for type \"$3\"" },
   { "~OperationNotPossibleWithTypes_234", "\"$2\": operation not possible with parameters of type \"$3\" and \"$4\"" },
-  { "~ParseFragmentInvalidOptions", "invalid options passed to the parse-xml:parse() function, the element must in the schema target namespace" },
+  { "~ParseFragmentDoctypeNotAllowed", "a DOCTYPE declaration is not allowed" },
+  { "~ParseFragmentDoctypeNotAllowedHere", "a DOCTYPE declaration must appear before any element or text node, and at most once" },
+  { "~ParseFragmentInvalidOptions", "invalid options passed to the parse-xml:parse() function, the element must be in the schema target namespace" },
   { "~ParseFragmentOptionCombinationNotAllowed", "only one of the <schema-validate/>, <DTD-validate/> or <parse-external-parsed-entity/> options can be specified" },
   { "~ParserInitFailed", "parser initialization failed" },
   { "~ParserNoCreateTree", "XML tree creation failed" },

=== modified file 'src/runtime/parsing_and_serializing/fragment_istream.h'
--- src/runtime/parsing_and_serializing/fragment_istream.h	2012-07-12 17:29:55 +0000
+++ src/runtime/parsing_and_serializing/fragment_istream.h	2012-07-17 15:50:41 +0000
@@ -33,6 +33,13 @@
   static const unsigned int BUFFER_SIZE = 4096;
   static const unsigned int LOOKAHEAD_BYTES = 3; // lookahead fetching is implemented, but currently not used
   static const unsigned int PARSED_NODES_BATCH_SIZE = 1024;
+  
+  // names of these states are orientative
+  enum FRAGMENT_PARSER_STATE {
+    FRAGMENT_FIRST_START_DOC = 0,
+    FRAGMENT_PROLOG,
+    FRAGMENT_CONTENT                   // this state is set once an element is encountered
+  };
 
 public:
   std::istringstream* theIss;
@@ -43,7 +50,7 @@
   int current_element_depth;
   int root_elements_to_skip;
   xmlParserCtxtPtr ctxt;
-  bool first_start_doc;
+  FRAGMENT_PARSER_STATE state;
   bool forced_parser_stop;
   bool reached_eof;
   unsigned int parsed_nodes_count;
@@ -63,7 +70,7 @@
     current_element_depth(0),
     root_elements_to_skip(0),
     ctxt(NULL),
-    first_start_doc(true),
+    state(FRAGMENT_FIRST_START_DOC),
     forced_parser_stop(false),
     reached_eof(false),
     parsed_nodes_count(0),
@@ -103,7 +110,7 @@
     current_element_depth = 0;
     root_elements_to_skip = 0;
     ctxt = NULL;
-    first_start_doc = true;
+    state = FRAGMENT_FIRST_START_DOC;
     forced_parser_stop = false;
     reached_eof = false;
     parsed_nodes_count = 0;

=== modified file 'src/runtime/parsing_and_serializing/parse_fragment_impl.cpp'
--- src/runtime/parsing_and_serializing/parse_fragment_impl.cpp	2012-07-12 17:29:55 +0000
+++ src/runtime/parsing_and_serializing/parse_fragment_impl.cpp	2012-07-17 15:50:41 +0000
@@ -145,6 +145,8 @@
           props.setSkipRootNodes(ztd::aton<xs_int>(attr->getStringValue().c_str()));
         else if (attr->getNodeName()->getLocalName() == "skip-top-level-text-nodes")
           props.setSkipTopLevelTextNodes(true);
+        else if (attr->getNodeName()->getLocalName() == "error-on-doctype")
+          props.setErrorOnDoctype(true);
       }
       attribs->close();
     }

=== modified file 'src/store/api/load_properties.h'
--- src/store/api/load_properties.h	2012-07-12 17:29:55 +0000
+++ src/store/api/load_properties.h	2012-07-17 15:50:41 +0000
@@ -46,6 +46,10 @@
   bool theParseExternalParsedEntity;
   unsigned int theSkipRootNodes;
   bool theSkipTopLevelTextNodes;
+  bool theErrorOnDoctype;       // Used by the fragment parser. By default it will allow Doctype 
+                                // declarations. But if a Doctype declaration is
+                                // present, and the flag is set to true, an error will be generated.
+  
   bool theSubstituteEntities;
   bool theXincludeSubstitutions;
   bool theRemoveRedundantNS;
@@ -73,6 +77,7 @@
     theParseExternalParsedEntity(false),
     theSkipRootNodes(0),
     theSkipTopLevelTextNodes(false),
+    theErrorOnDoctype(false),
     theSubstituteEntities(false),
     theXincludeSubstitutions(false),
     theRemoveRedundantNS(false),
@@ -100,6 +105,7 @@
     theParseExternalParsedEntity = false;
     theSkipRootNodes = 0;
     theSkipTopLevelTextNodes = false;
+    theErrorOnDoctype = false;
     theSubstituteEntities = false;
     theXincludeSubstitutions = false;
     theRemoveRedundantNS = false;
@@ -238,6 +244,16 @@
   {
     return theSkipTopLevelTextNodes;
   }
+  
+  // theSkipTopLevelTextNodes
+  void setErrorOnDoctype(bool aErrorOnDoctype)
+  {
+    theErrorOnDoctype = aErrorOnDoctype;
+  }
+  bool getErrorOnDoctype() const
+  {
+    return theErrorOnDoctype;
+  }
 
   // theSubstituteEntities
   void setSubstituteEntities(bool aSubstituteEntities)

=== modified file 'src/store/naive/loader.h'
--- src/store/naive/loader.h	2012-07-12 17:29:55 +0000
+++ src/store/naive/loader.h	2012-07-17 15:50:41 +0000
@@ -306,6 +306,12 @@
         void * ctx,
         const xmlChar * target,
         const xmlChar * data);
+  
+  static void internalSubset(
+        void *ctx,
+        const xmlChar *name,
+        const xmlChar *ExternalID,
+        const xmlChar *SystemID);
 
 protected:
   FragmentIStream* theFragmentStream;

=== modified file 'src/store/naive/loader_dtd.cpp'
--- src/store/naive/loader_dtd.cpp	2012-07-12 17:29:55 +0000
+++ src/store/naive/loader_dtd.cpp	2012-07-17 15:50:41 +0000
@@ -141,6 +141,7 @@
   theSaxHandler.getEntity = &FragmentXmlLoader::getEntity;
   theSaxHandler.getParameterEntity = &FragmentXmlLoader::getParameterEntity;
   theSaxHandler.entityDecl = &FragmentXmlLoader::entityDecl;
+  theSaxHandler.internalSubset = &FragmentXmlLoader::internalSubset;
 }
 
 
@@ -251,7 +252,7 @@
     theFragmentStream->parsed_nodes_count = 0;
     theFragmentStream->forced_parser_stop = false;
 
-    if ( ! theFragmentStream->first_start_doc)
+    if (theFragmentStream->state != FragmentIStream::FRAGMENT_FIRST_START_DOC)
     {
       theFragmentStream->ctxt->instate = XML_PARSER_CONTENT;
       FragmentXmlLoader::startDocument(theFragmentStream->ctxt->userData);
@@ -259,9 +260,7 @@
 
     while ( ! theFragmentStream->forced_parser_stop && fillBuffer(theFragmentStream))
     {
-      // std::cerr << "\n==================\n--> skip_root: " << theFragmentStream->root_elements_to_skip << " current_depth: " << theFragmentStream->current_element_depth << " about to parse: [" << theFragmentStream->ctxt->input->cur << "] " << std::endl;
-
-      if (theFragmentStream->only_one_doc_node && !theFragmentStream->first_start_doc)
+      if (theFragmentStream->only_one_doc_node && theFragmentStream->state != FragmentIStream::FRAGMENT_FIRST_START_DOC)
       {
         theFragmentStream->ctxt->instate = XML_PARSER_CONTENT;
         theFragmentStream->ctxt->disableSAX = false; // xmlStopParser() sets disableSAX to true
@@ -278,7 +277,51 @@
             );
         throw 0; // the argument to throw is not used by the catch clause
       }
-
+      
+      // parse the DOCTYPE declaration, if any
+      if (theFragmentStream->ctxt->input->cur[0] == '<' &&
+          theFragmentStream->ctxt->input->cur[1] == '!' &&
+          theFragmentStream->ctxt->input->cur[2] == 'D' &&
+          theFragmentStream->ctxt->input->cur[3] == 'O' &&
+          theFragmentStream->ctxt->input->cur[4] == 'C' &&
+          theFragmentStream->ctxt->input->cur[5] == 'T' &&
+          theFragmentStream->ctxt->input->cur[6] == 'Y' &&
+          theFragmentStream->ctxt->input->cur[7] == 'P' &&
+          theFragmentStream->ctxt->input->cur[8] == 'E')
+      {
+        if (theFragmentStream->state == FragmentIStream::FRAGMENT_PROLOG
+            &&
+            theLoadProperties.getErrorOnDoctype() == false)
+        {
+          theFragmentStream->ctxt->instate = XML_PARSER_MISC;
+        }
+        else if (theFragmentStream->state != FragmentIStream::FRAGMENT_FIRST_START_DOC)
+        {
+          if (theFragmentStream->state != FragmentIStream::FRAGMENT_PROLOG)
+          {
+            theXQueryDiagnostics->add_error(theDocUri.empty() ?
+              NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParseFragmentDoctypeNotAllowedHere ))) :
+              NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParseFragmentDoctypeNotAllowedHere ), theDocUri))
+            );
+            throw 0; // the argument to throw is not used by the catch clause
+          }
+          else // theLoadProperties.getErrorOnDoctype() == true
+          {
+            theXQueryDiagnostics->add_error(theDocUri.empty() ?
+              NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParseFragmentDoctypeNotAllowed ))) :
+              NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParseFragmentDoctypeNotAllowed ), theDocUri))
+            );
+            throw 0; // the argument to throw is not used by the catch clause
+          }
+        }
+      }
+      
+      /*      
+      std::cerr << "\n==================\n--> skip_root: " << theFragmentStream->root_elements_to_skip << " current_depth: " << theFragmentStream->current_element_depth 
+          << " state: " << theFragmentStream->ctxt->instate 
+          << " about to parse: [" << theFragmentStream->ctxt->input->cur << "] " << std::endl;
+      */
+      
       xmlParseChunk(theFragmentStream->ctxt, (const char*)theFragmentStream->ctxt->input->cur,
                     theFragmentStream->ctxt->input->length, 0);
 
@@ -287,7 +330,7 @@
           &&
           theFragmentStream->current_offset == 0)
       {
-        if (theFragmentStream->first_start_doc)
+        if (theFragmentStream->state == FragmentIStream::FRAGMENT_FIRST_START_DOC)
           FragmentXmlLoader::startDocument(theFragmentStream->ctxt->userData);
         xmlParseCharData(theFragmentStream->ctxt, 0);
         theFragmentStream->current_offset = getCurrentInputOffset(); // update current offset
@@ -310,7 +353,7 @@
     }
     
     // this happens when the input is an empty string
-    if (theFragmentStream->first_start_doc
+    if (theFragmentStream->state == FragmentIStream::FRAGMENT_FIRST_START_DOC
         &&
         theFragmentStream->stream_is_consumed())
       FragmentXmlLoader::startDocument(theFragmentStream->ctxt->userData);
@@ -363,6 +406,7 @@
   return resultNode;
 }
 
+
 unsigned long FragmentXmlLoader::getCurrentInputOffset() const
 {
   unsigned long offset = theFragmentStream->ctxt->input->cur
@@ -372,6 +416,7 @@
   return offset;
 }
 
+
 void FragmentXmlLoader::checkStopParsing(void* ctx, bool force)
 {
   FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
@@ -402,23 +447,26 @@
   loader.theFragmentStream->parsed_nodes_count++;
 }
 
+
 void FragmentXmlLoader::startDocument(void * ctx)
 {
   FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
   ZORBA_LOADER_CHECK_ERROR(loader);
   FastXmlLoader::startDocument(ctx);
-  if (loader.theFragmentStream->first_start_doc)
+  if (loader.theFragmentStream->state == FragmentIStream::FRAGMENT_FIRST_START_DOC)
   {
-    loader.theFragmentStream->first_start_doc = false;
+    loader.theFragmentStream->state = FragmentIStream::FRAGMENT_PROLOG;
     FragmentXmlLoader::checkStopParsing(ctx, true);
   }
 }
 
+
 void FragmentXmlLoader::endDocument(void * ctx)
 {
   FastXmlLoader::endDocument(ctx);
 }
 
+
 void FragmentXmlLoader::startElement(
     void * ctx,
     const xmlChar * localname,
@@ -432,6 +480,7 @@
 {
   FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
   ZORBA_LOADER_CHECK_ERROR(loader);
+  loader.theFragmentStream->state = FragmentIStream::FRAGMENT_CONTENT;
   loader.theFragmentStream->current_element_depth++;
   if (loader.theFragmentStream->current_element_depth > loader.theFragmentStream->root_elements_to_skip)
   {
@@ -447,6 +496,7 @@
   }
 }
 
+
 void FragmentXmlLoader::endElement(
     void * ctx,
     const xmlChar * localname,
@@ -461,6 +511,7 @@
   checkStopParsing(ctx);
 }
 
+
 void FragmentXmlLoader::characters(
     void * ctx,
     const xmlChar * ch,
@@ -512,6 +563,20 @@
 }
 
 
+void FragmentXmlLoader::internalSubset(
+    void *ctx,
+    const xmlChar *name,
+    const xmlChar *ExternalID,
+    const xmlChar *SystemID)
+{
+  FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
+  ZORBA_LOADER_CHECK_ERROR(loader);
+  loader.theFragmentStream->state = FragmentIStream::FRAGMENT_CONTENT;
+  checkStopParsing(ctx);
+  loader.theFragmentStream->current_offset++;
+}
+
+
 /*******************************************************************************
 
 ********************************************************************************/

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-01.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-01.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-01.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-02.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-02.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-02.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-03.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-03.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-03.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-04.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-04.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-04.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-05.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-05.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-05.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-06.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-06.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-06.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+Jani
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-07.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-07.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-07.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- comment -->
+
+<!-- comment -->
+Jani
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-08.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-08.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-08.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+JaniJaniJani
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-11.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-11.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-doctype-11.xml.res	2012-07-17 15:50:41 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- comment -->
+
+<!-- comment -->
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>
\ No newline at end of file

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-01.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-01.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-01.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,12 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-02.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-02.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-02.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,13 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-03.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-03.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-03.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,13 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-04.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-04.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-04.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,14 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-05.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-05.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-05.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,13 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"<?xml version='1.0'?>
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-06.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-06.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-06.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,12 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+Jani
+<from3>Jani</from3>", 
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)
+

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-07.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-07.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-07.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,15 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"
+<!-- comment -->
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<!-- comment -->
+Jani
+<from3>Jani</from3>", 
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)
+

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-08.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-08.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-08.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,12 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-09.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-09.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-09.spec	2012-07-17 15:50:41 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:FODC0006

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-09.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-09.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-09.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,13 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"
+<from1>Jani</from1>
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-10.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-10.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-10.spec	2012-07-17 15:50:41 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:FODC0006

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-10.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-10.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-10.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,13 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-11.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-11.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-11.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,15 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"<?xml version='1.0'?>
+<!-- comment -->
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<!-- comment -->
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity/>
+</opt:options>
+)

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-12.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-12.spec	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-12.spec	2012-07-17 15:50:41 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:FODC0006

=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-12.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-12.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-doctype-12.xq	2012-07-17 15:50:41 +0000
@@ -0,0 +1,13 @@
+import module namespace x = "http://www.zorba-xquery.com/modules/xml";;
+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";;
+
+x:parse(
+"<?xml version='1.0'?>
+<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
+<from1>Jani</from1>
+<from2>Jani</from2>
+<from3>Jani</from3>",
+<opt:options>
+  <opt:parse-external-parsed-entity opt:error-on-doctype="true"/>
+</opt:options>
+)

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to