Skip to content

Commit

Permalink
Merge pull request #1288 from michaelhkay/1287-parse-xml-errors
Browse files Browse the repository at this point in the history
1287 Define parse-xml error conditions
  • Loading branch information
michaelhkay authored Jun 25, 2024
2 parents 99668bc + c0c6403 commit b3e4b5c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
24 changes: 20 additions & 4 deletions specifications/xpath-functions-40/src/function-catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17852,10 +17852,26 @@ return tokenize(normalize-space($s), ' ')[. castable as xs:IDREF]</eg>
<p>A dynamic error is raised <errorref class="DC" code="0006"
/> if the content of
<code>$value</code> is not a well-formed and namespace-well-formed XML document.</p>
<p>A dynamic error is raised <errorref class="DC" code="0006"
/> if validation is
carried out and the content of <code>$value</code> is not valid against the relevant DTD
or XSD schema.</p>
<p>A dynamic error is raised <errorref class="DC" code="0007"
/> if DTD validation is
carried out and the content of <code>$value</code> is not valid against the relevant DTD.</p>
<p>A dynamic error is raised <errorref class="DC" code="0008"
/> if the value of the <code>xsd-validation</code> option is not one of the
permitted values (for example, if the string that follows <code>"type"</code>
is not a valid <code>EQName</code>, or if it does not identify a type that is present in the
static context).</p>
<p>A dynamic error is raised <errorref class="DC" code="0009"
/> if the value of the <code>xsd-validation</code> option is set to anything
other than <code>skip</code> when the processor is not schema-aware. (XSLT 4.0
and XQuery 4.0 define schema-awareness as an optional feature; other host languages
may set their own rules.)</p>
<p>A dynamic error is raised <errorref class="DC" code="0013"
/> if DTD validation is requested and the processor does not have
access to a validating XML parser.</p>

<p>A dynamic error is raised <errorref class="DC" code="0014"
/> if XSD validation is
carried out and the content of <code>$value</code> is not valid against the relevant XSD schema.</p>
</fos:errors>
<fos:notes>
<p>Since the XML document is presented to the parser as a string, rather than as a sequence
Expand Down
30 changes: 29 additions & 1 deletion specifications/xpath-functions-40/src/xpath-functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11230,6 +11230,22 @@ ISBN 0 521 77752 6.</bibl>
<p>Raised by <code>fn:parse-xml</code> if the supplied string is not a well-formed and namespace-well-formed XML document;
or if DTD validation is requested and the document is not valid against its DTD.</p>
</error>
<error class="DC" code="0007" label="String passed to fn:parse-xml is not a DTD-valid XML document."
type="dynamic">
<p>Raised by <code>fn:parse-xml</code> if DTD validation is requested and the supplied string
has no DTD or is not valid against the DTD.</p>
</error>
<error class="DC" code="0008" label="Invalid value for the xsd-validation option of fn:parse-xml."
type="dynamic">
<p>Raised when the <code>xsd-validation</code> option to <code>fn:parse-xml</code> is supplied,
and the value is not one of the permitted values; for example if the option <code>type Q{U}NNN</code>
is used, and <code>Q{U}NNN</code> does not identify a type in the static context.</p>
</error>
<error class="DC" code="0009" label="Processor is not schema-aware."
type="dynamic">
<p>Raised when the <code>xsd-validation</code> option to <code>fn:parse-xml</code> is set to
a value other than <code>skip</code>, if the processor is not schema-aware.</p>
</error>

<error class="DC" code="0010" label="The processor does not support serialization."
type="dynamic">
Expand All @@ -11245,7 +11261,19 @@ ISBN 0 521 77752 6.</bibl>
<p>Raised by <code>fn:parse-html</code> if a key passed to <code>$options</code>, or its value,
is not supported by the implementation.</p>
</error>
<error class="DF" code="1280" label="Invalid decimal format name."
<error class="DC" code="0013" label="No validating XML parser available."
type="dynamic">
<p>Raised when the <code>dtd-validation</code> option to <code>fn:parse-xml</code> is set,
if no validating XML parser is available. Note: it is <rfc2119>recommended</rfc2119>
that all processors should support the <code>dtd-validation</code> option, but there
may be environments (such as web browsers) where this is not practically feasible.</p>
</error>
<error class="DC" code="0014" label="String passed to fn:parse-xml is not a schema-valid XML document."
type="dynamic">
<p>Raised by <code>fn:parse-xml</code> if XSD validation is requested and the XML document
represented by the supplied string is not valid against the relevant XSD schema.</p>
</error>
<error class="DF" code="1280" label="Invalid decimal format name."
type="dynamic">
<p>This error is raised if the decimal format name supplied to <code>fn:format-number</code> is not a valid QName,
or if the prefix in the QName is undeclared, or if there is no decimal format in the static context with
Expand Down

0 comments on commit b3e4b5c

Please sign in to comment.