]> dreyeck.freedombox.rocks Git - topic-maps.git/blobdiff - src/ctm/reader.lisp
Verify CTM/XTM semantic equivalence through TMDM and CXTM (Slice 22F)
[topic-maps.git] / src / ctm / reader.lisp
index 3edec0928ee4198dd5ff4e14376bbc683f23624f..f8741a7e8b59aab4f711aeed6fd3d37729047dcb 100644 (file)
@@ -180,9 +180,10 @@ The owning information item is not constructed until this function finishes."
                              :datetime-bce-timezone-rollover :datetime-leap-second-context)
                          (token-position token) "DateTime normalization is outside the supported BCE/leap-second calendar context."))
          (values value (topic-maps.tmdm:datetime-datatype))))
-      (:excluded-literal
-       (problem 'ctm-unsupported (if (eq context :variant) :variant-literal-datatype :occurrence-literal-datatype) (token-position token)
-                "The separate CTM '*' literal is outside this slice."))
+      (:ctm-integer
+       (consume parser)
+       ;; CTM 3.4.1 [33]: opaque lexical value, unrelated to Wildcards/counters.
+       (values "*" "http://psi.topicmaps.org/iso13250/ctm-integer"))
       (:string
        (consume parser)
        (if (punctuation-p parser #\^)
@@ -425,8 +426,8 @@ Use the shared Topic reference resolver."
                  "Encoding declaration must be the first characters of the CTM stream."))
       (multiple-value-bind (name end position)
           (ctm-encoding-name *source-text* (token-position token) :character)
-        (unless (string-equal name "UTF-8")
-          (problem 'ctm-unsupported :unsupported-encoding position "Only UTF-8 CTM input is implemented."))
+        (unless (ctm-encoding-kind name)
+          (problem 'ctm-unsupported :unsupported-encoding position "Only UTF-8 and ISO-8859-5 CTM input are implemented."))
         (setf (lexer-cursor (parser-lexer parser)) end))))
   (when (and (eq :directive (token-kind (look parser)))
              (string= "version" (token-value (look parser))))
@@ -502,7 +503,7 @@ The resolver receives :PURPOSE (:INCLUDE or :MERGEMAP), :FROM-DOCUMENT-IRI and
 (defun deserialize-file (pathname &key document-iri source-name encoding (wildcard-iri document-iri) (wildcard-counter 0)
                                         resource-resolver (max-resource-depth 32))
   "Read CTM octets using an explicit Document IRI and optional supplied ENCODING.
-Check supplied encoding/BOM/declaration conflicts before strict UTF-8 decoding.
+Check supplied encoding/BOM/declaration conflicts before UTF-8 or ISO-8859-5 decoding.
 Other charsets remain UNSUPPORTED. File I/O errors propagate unchanged."
   (let ((*source-name* source-name) (*source-text* ""))
     (require-document-iri document-iri)