Common Lisp Package: CXML-TYPES

@code{cxml-types} defines an extensible interface for XML-related data types as required for use in Relax NG validation. It includes Relax NG's minimal built-in type library, which is named @code{:||} and defines the types "string" and "token". In addition, it implements the built-in types of @a[http://www.w3.org/TR/xmlschema-2/]{XML Schema Datatypes} as specified in @a[http://relaxng.org/xsd-20010907.html]{Guidelines for using W3C XML Schema Datatypes with RELAX NG}. The XSD type library is named @code{:|http://www.w3.org/2001/XMLSchema-datatypes|}. The types defined by @a[http://relaxng.org/compatibility-20011203.html]{ RELAX NG DTD Compatibility} are available through the data type library named @code{:|http://relaxng.org/ns/compatibility/datatypes/1.0|}. @begin[Example]{section} @begin{pre} * (setf ttt (cxml-types:find-type :|| "token")) #<CXML-TYPES:TOKEN-TYPE {1002D16B71@}> * (cxml-types:parse ttt "a b") "a b" * (cxml-types:parse ttt "a b") "a b" * (cxml-types:equal-using-type ttt ** *) T @end{pre} @end{section} @begin[Type instances]{section} Each type, together with its parameters, is represented by an instance of @code{data-type}. The generic function @fun{find-type}, defined for each library, creates type instances. A type's properties are accessible using @fun{type-name}, @fun{type-library}, and @fun{type-context-dependent-p}. @aboutclass{data-type} @aboutclass{rng-type} @aboutclass{xsd-type} @aboutfun{find-type} @aboutfun{type-name} @aboutfun{type-library} @aboutfun{type-context-dependent-p} @end{section} @begin[Using types]{section} Types allow strings to be tested for validity and equality. @fun{validp} checks whether a string can be parsed. If it is valid, @fun{parse} will compute the string's @emph{value}, and return a Lisp object of a type-specific class as a representation of that value. Values returned by @fun{parse} can be compared for equality using @fun{equal-using-type}. Some types also define a partial ordering, which can be queried using @fun{lessp-using-type}. @aboutfun{validp} @aboutfun{parse} @aboutfun{equal-using-type} @aboutfun{lessp-using-type} @end{section} @begin[The validation context]{section} Some types are context dependent, as indicated by @fun{type-context-dependent-p}. Those types need access to state computed by the XML parser implicitly, like namespace bindings or the Base URI. An abstract class @class{validation-context} is defined that users of this API can implement a subclass of to define methods for the generic functions listed below. In addition, two pre-defined validation context implementations are provided, one for use with SAX, the other based on Klacks. @aboutclass{validation-context} @aboutclass{sax-validation-context-mixin} @aboutclass{klacks-validation-context} @aboutfun{context-find-namespace-binding} @aboutfun{context-find-unparsed-entity} @end{section} @begin[Relax NG built-in types]{section} The following primitive types are defined by Relax NG: @aboutclass{string-type} @aboutclass{token-type} @end{section} @begin[DTD compatibility types]{section} The following primitive types are defined by Relax NG DTD Compatibility: @aboutclass{id-type} @aboutclass{idref-type} @aboutclass{idrefs-type} @end{section} @begin[Primitive XSD built-in types]{section} The following primitive types are part of the XSD built-in data type library: @aboutclass{duration-type} @aboutclass{date-time-type} @aboutclass{time-type} @aboutclass{date-type} @aboutclass{year-month-type} @aboutclass{year-type} @aboutclass{month-day-type} @aboutclass{day-type} @aboutclass{month-type} @aboutclass{boolean-type} @aboutclass{base64-binary-type} @aboutclass{hex-binary-type} @aboutclass{float-type} @aboutclass{decimal-type} @aboutclass{double-type} @aboutclass{any-uri-type} @aboutclass{qname-type} @aboutclass{notation-type} @aboutclass{xsd-string-type} @end{section} @begin[Enumerated XSD built-in types]{section} The following types are part of the XSD built-in data type library, and are defined as derived types through enumeration. Relax NG does not implement the enumeration facet, so although these types are described as "derived", they are implemented directly. @aboutclass{xsd-idrefs-type} @aboutclass{entities-type} @aboutclass{nmtokens-type} @end{section} @begin[Derived XSD built-in types]{section} The following types are part of the XSD built-in data type library, and are defined as derived types through restriction. @aboutclass{normalized-string-type} @aboutclass{xsd-token-type} @aboutclass{language-type} @aboutclass{name-type} @aboutclass{ncname-type} @aboutclass{xsd-id-type} @aboutclass{xsd-idref-type} @aboutclass{entity-type} @aboutclass{nmtoken-type} @aboutclass{integer-type} @aboutclass{non-positive-integer-type} @aboutclass{negative-integer-type} @aboutclass{long-type} @aboutclass{int-type} @aboutclass{short-type} @aboutclass{byte-type} @aboutclass{non-negative-integer-type} @aboutclass{unsigned-long-type} @aboutclass{unsigned-int-type} @aboutclass{unsigned-short-type} @aboutclass{unsigned-byte-type} @aboutclass{positive-integer-type} @end{section}

README:

FUNCTION

Public

MAKE-KLACKS-VALIDATION-CONTEXT (SOURCE)

@arg[source]{a @a[http://common-lisp.net/project/cxml/klacks.html]{ klacks source}} @return{a @class{klacks-validation-context}} Create a validation-context that will query the given klacks source for the current parser context.

MAKE-PARAM (NAME VALUE)

@arg[name]{parameter name, a string} @arg[value]{parameter value, a string} @return{a @class{param}} Create a data type parameter. @see{param-name} @see{param-value}

PARAM-NAME (INSTANCE)

@arg[instance]{an instance of @class{param}} @return{a string} The data type parameter's name. @see{param-value}

PARAM-VALUE (INSTANCE)

@arg[instance]{an instance of @class{param}} @return{a string} The data type parameter's value. @see{param-name}

Undocumented

SETFPARAM-NAME (NEW-VALUE INSTANCE)

SETFPARAM-VALUE (NEW-VALUE INSTANCE)

Private

COLLECT-CHAR-CLASS (LEXER)

Reads and consumes characters from regex string until a right bracket is seen. Assembles them into a list (which is returned) of characters, character ranges, like (:RANGE #\A #\E) for a-e, and tokens representing special character classes.

END-OF-STRING-P (LEXER)

Tests whether we're at the end of the regex string.

FAIL (LEXER)

Moves (LEXER-POS LEXER) back to the last position stored in (LEXER-LAST-POS LEXER) and pops the LAST-POS stack.

GET-NUMBER (LEXER &KEY (RADIX 10) MAX-LENGTH NO-WHITESPACE-P)

Read and consume the number the lexer is currently looking at and return it. Returns NIL if no number could be identified. RADIX is used as in PARSE-INTEGER. If MAX-LENGTH is not NIL we'll read at most the next MAX-LENGTH characters. If NO-WHITESPACE-P is not NIL we don't tolerate whitespace in front of the number.

GET-QUANTIFIER (LEXER)

Returns a list of two values (min max) if what the lexer is looking at can be interpreted as a quantifier. Otherwise returns NIL and resets the lexer to its old position.

GET-TOKEN (LEXER)

Returns and consumes the next token from the regex string (or NIL).

GREEDY-QUANT (LEXER)

Parses and consumes a <greedy-quant>. The productions are: <greedy-quant> -> <group> | <group><quantifier> where <quantifier> is parsed by the lexer function GET-QUANTIFIER. Will return <parse-tree> or (:GREEDY-REPETITION <min> <max> <parse-tree>).

GROUP (LEXER)

Parses and consumes a <group>. The productions are: <group> -> "("<regex>")" <legal-token> Will return <parse-tree> or (<grouping-type> <parse-tree>) where <grouping-type> is one of six keywords - see source for details.

LEXER-LAST-POS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LEXER-LEN (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LEXER-POS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LEXER-STR (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LOOKING-AT-P (LEXER CHR)

Tests whether the next character the lexer would see is CHR. Does not respect extended mode.

MAKE-CHAR-FROM-CODE (NUMBER ERROR-POS)

Create character from char-code NUMBER. NUMBER can be NIL which is interpreted as 0. ERROR-POS is the position where the corresponding number started within the regex string.

MAP-CHAR-TO-SPECIAL-CHAR-CLASS (CHR LEXER)

Maps escaped characters like "\d" to the tokens which represent their associated character classes.

NEXT-CHAR-NON-EXTENDED (LEXER)

Returns the next character which is to be examined and updates the POS slot. Does not respect extended mode.

PARSE-PATTERN (STRING)

Translate the regex string STRING into a parse tree.

QNAME-LENGTH (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

QNAME-LNAME (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

QNAME-URI (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REG-EXPR (LEXER)

Parses and consumes a <regex>, a complete regular expression. The productions are: <regex> -> <seq> | <seq>"|"<regex>. Will return <parse-tree> or (:ALTERNATION <parse-tree> <parse-tree>).

SEQ (LEXER)

Parses and consumes a <seq>. The productions are: <seq> -> <quant> | <quant><seq>. Will return <parse-tree> or (:SEQUENCE <parse-tree> <parse-tree>).

START-OF-SUBEXPR-P (LEXER)

Tests whether the next token can start a valid sub-expression, i.e. a stand-alone regex.

UNESCAPE-CHAR (LEXER)

Convert the characters(s) following a backslash into a token which is returned. This function is to be called when the backslash has already been consumed. Special character classes like \W are handled elsewhere.

UNGET-TOKEN (LEXER)

Moves the lexer back to the last position stored in the LAST-POS stack.

Undocumented

. (CHARACTER)

<-USING-TYPE (TYPE U V)

<=-USING-TYPE (TYPE U V)

>-USING-TYPE (TYPE U V)

>=-USING-TYPE (TYPE U V)

\C (CHARACTER)

\D (CHARACTER)

\I (CHARACTER)

\S (CHARACTER)

\W (CHARACTER)

^C (CHARACTER)

^D (CHARACTER)

^I (CHARACTER)

^S (CHARACTER)

^W (CHARACTER)

CONVERT-SUBSTRACTION (R S)

COPY-LEXER (INSTANCE)

COPY-PARAM (INSTANCE)

COPY-QNAME (INSTANCE)

DATETIME+DURATION (S D)

DATETIME+TIMEZONE (D H M)

DAY-LIMIT (M Y)

DO-NOT-CONSTANT-FOLD-ME (X)

SETFLEXER-LAST-POS (NEW-VALUE INSTANCE)

LEXER-P (OBJECT)

SETFLEXER-POS (NEW-VALUE INSTANCE)

MAKE-LEXER (STRING)

MAKE-LEXER-INTERNAL (&KEY ((STR DUM48) ) ((LEN DUM49) 0) ((POS DUM50) 0) ((LAST-POS DUM51) NIL))

MAKE-QNAME (URI LNAME LENGTH)

MASSAGE-RANGES (L)

MAX* (A B)

MIN* (A B)

NAMEP (STR)

NEXT-CHAR (LEXER)

NORMALIZE-DATE-TIME (U)

NORMALIZE-WHITESPACE (STR)

PARAM-P (OBJECT)

PARSE-FLOAT (E MIN MAX +INF -INF NAN)

PARSE-PARAMETERS (TYPE-CLASS PARAMS)

PARSE-TIME (MINUSP Y M D H MIN S TZ TZ-SIGN TZ-H TZ-M &KEY (START 0) END)

p{Cc} (CHARACTER)

p{Cf} (CHARACTER)

p{Cn} (CHARACTER)

p{Co} (CHARACTER)

p{C} (CHARACTER)

p{isAlphabeticPresentationForms} (CHARACTER)

p{isArabicPresentationForms-A} (CHARACTER)

p{isArabicPresentationForms-B} (CHARACTER)

p{isArabic} (CHARACTER)

p{isArmenian} (CHARACTER)

p{isArrows} (CHARACTER)

p{isBasicLatin} (CHARACTER)

p{isBengali} (CHARACTER)

p{isBlockElements} (CHARACTER)

p{isBopomofoExtended} (CHARACTER)

p{isBopomofo} (CHARACTER)

p{isBoxDrawing} (CHARACTER)

p{isBraillePatterns} (CHARACTER)

p{isCherokee} (CHARACTER)

p{isCJKCompatibilityForms} (CHARACTER)

p{isCJKCompatibilityIdeographs} (CHARACTER)

p{isCJKCompatibility} (CHARACTER)

p{isCJKRadicalsSupplement} (CHARACTER)

p{isCJKSymbolsandPunctuation} (CHARACTER)

p{isCJKUnifiedIdeographsExtensionA} (CHARACTER)

p{isCJKUnifiedIdeographs} (CHARACTER)

p{isCombiningDiacriticalMarks} (CHARACTER)

p{isCombiningHalfMarks} (CHARACTER)

p{isCombiningMarksforSymbols} (CHARACTER)

p{isControlPictures} (CHARACTER)

p{isCurrencySymbols} (CHARACTER)

p{isCyrillic} (CHARACTER)

p{isDevanagari} (CHARACTER)

p{isDingbats} (CHARACTER)

p{isEnclosedAlphanumerics} (CHARACTER)

p{isEnclosedCJKLettersandMonths} (CHARACTER)

p{isEthiopic} (CHARACTER)

p{isGeneralPunctuation} (CHARACTER)

p{isGeometricShapes} (CHARACTER)

p{isGeorgian} (CHARACTER)

p{isGreekExtended} (CHARACTER)

p{isGreek} (CHARACTER)

p{isGujarati} (CHARACTER)

p{isGurmukhi} (CHARACTER)

p{isHalfwidthandFullwidthForms} (CHARACTER)

p{isHangulCompatibilityJamo} (CHARACTER)

p{isHangulJamo} (CHARACTER)

p{isHangulSyllables} (CHARACTER)

p{isHebrew} (CHARACTER)

p{isHiragana} (CHARACTER)

p{isIdeographicDescriptionCharacters} (CHARACTER)

p{isIPAExtensions} (CHARACTER)

p{isKanbun} (CHARACTER)

p{isKangxiRadicals} (CHARACTER)

p{isKannada} (CHARACTER)

p{isKatakana} (CHARACTER)

p{isKhmer} (CHARACTER)

p{isLao} (CHARACTER)

p{isLatin-1Supplement} (CHARACTER)

p{isLatinExtended-A} (CHARACTER)

p{isLatinExtended-B} (CHARACTER)

p{isLatinExtendedAdditional} (CHARACTER)

p{isLetterlikeSymbols} (CHARACTER)

p{isMalayalam} (CHARACTER)

p{isMathematicalOperators} (CHARACTER)

p{isMiscellaneousSymbols} (CHARACTER)

p{isMiscellaneousTechnical} (CHARACTER)

p{isMongolian} (CHARACTER)

p{isMyanmar} (CHARACTER)

p{isNumberForms} (CHARACTER)

p{isOgham} (CHARACTER)

p{isOpticalCharacterRecognition} (CHARACTER)

p{isOriya} (CHARACTER)

p{isPrivateUse} (CHARACTER)

p{isRunic} (CHARACTER)

p{isSinhala} (CHARACTER)

p{isSmallFormVariants} (CHARACTER)

p{isSpacingModifierLetters} (CHARACTER)

p{isSpecials} (CHARACTER)

p{isSuperscriptsandSubscripts} (CHARACTER)

p{isSyriac} (CHARACTER)

p{isTamil} (CHARACTER)

p{isTelugu} (CHARACTER)

p{isThaana} (CHARACTER)

p{isThai} (CHARACTER)

p{isTibetan} (CHARACTER)

p{isUnifiedCanadianAboriginalSyllabics} (CHARACTER)

p{isYiRadicals} (CHARACTER)

p{isYiSyllables} (CHARACTER)

p{Ll} (CHARACTER)

p{Lm} (CHARACTER)

p{Lo} (CHARACTER)

p{Lt} (CHARACTER)

p{Lu} (CHARACTER)

p{L} (CHARACTER)

p{Mc} (CHARACTER)

p{Me} (CHARACTER)

p{Mn} (CHARACTER)

p{M} (CHARACTER)

p{Nd} (CHARACTER)

p{Nl} (CHARACTER)

p{No} (CHARACTER)

p{N} (CHARACTER)

p{Pc} (CHARACTER)

p{Pd} (CHARACTER)

p{Pe} (CHARACTER)

p{Pf} (CHARACTER)

p{Pi} (CHARACTER)

p{Po} (CHARACTER)

p{Ps} (CHARACTER)

p{P} (CHARACTER)

p{Sc} (CHARACTER)

p{Sk} (CHARACTER)

p{Sm} (CHARACTER)

p{So} (CHARACTER)

p{S} (CHARACTER)

p{Zl} (CHARACTER)

p{Zp} (CHARACTER)

p{Zs} (CHARACTER)

p{Z} (CHARACTER)

SETFQNAME-LENGTH (NEW-VALUE INSTANCE)

SETFQNAME-LNAME (NEW-VALUE INSTANCE)

QNAME-P (OBJECT)

SETFQNAME-URI (NEW-VALUE INSTANCE)

QUANT (LEXER)

RANGE- (A B)

RANGES- (AA &REST BB)

RANGES-RANGE (AA B)

REPLACE-WHITESPACE (STR)

REVERSE-STRINGS (PARSE-TREE)

SCAN-TO-STRINGS (&REST ARGS)

SIGNAL-PPCRE-SYNTAX-ERROR (FMT &REST ARGS)

SIGNAL-PPCRE-SYNTAX-ERROR* (POS FMT &REST ARGS)

ZIP (KEYS VALUES)

MACRO

Private

Undocumented

DEFBLOCK (NAME MIN MAX)

DEFRANGES (NAME FORM)

DEFXSD ((CLASS-NAME TYPE-NAME) (&REST SUPERS) (&REST SLOTS) &REST ARGS)

MAYBE-COERCE-TO-SIMPLE-STRING (STRING)

PRECOMPILE (PATTERN)

GENERIC-FUNCTION

Public

CONTEXT-FIND-NAMESPACE-BINDING (CONTEXT PREFIX)

@arg[context]{an instance of @class{validation-context}} @arg[prefix]{name prefix, a string} @return{the namespace URI as a string, or NIL} @short{This function resolves a namespace prefix to a namespace URI in the current context.} All currently declared namespaces are taken into account, including those declared directly on the current element.

CONTEXT-FIND-UNPARSED-ENTITY (CONTEXT NAME)

@arg[context]{an instance of @class{validation-context}} @arg[name]{entity name, a string} @return{@code{nil}, or a list of public id, system id, and notation name} This function looks for an unparsed entity in the current context.

EQUAL-USING-TYPE (TYPE U V)

@arg[type]{an instance of @class{data-type}} @arg[u]{a parsed value as returned by @fun{parse}} @arg[v]{a parsed value as returned by @fun{parse}} @return{a boolean} @short{Compare the @emph{values} @code{u} and @code{v} using a data-type-dependent equality function.} @see{validp}

FIND-TYPE (LIBRARY NAME PARAMS)

@arg[library]{datatype library, a keyword symbol} @arg[name]{the type's name, a string} @arg[params]{type parameters, a list of @class{param} instances} @return{an instance of @class{data-type}, or @code{nil}} @short{Look up the type named @em{name} in datatype library @em{library}.} Additional parameters (knows as restricting facets in XSD) can be passed to specify or restrict the type for the purposes of @fun{validp}. Return a type instance for this type and the additional parameters, @code{nil} if the type does not exist, or @code{:error} if the type exists, but the specified parameters are not valid for that type. @see{data-type}

LESSP-USING-TYPE (TYPE U V)

@arg[type]{an ordered @class{data-type}} @arg[u]{a parsed value as returned by @fun{parse}} @arg[v]{a parsed value as returned by @fun{parse}} @return{a boolean} @short{Compare the @emph{values} @code{u} and @code{v} using a data-type-dependent partial ordering.} A method for this function is provided only by types that have a natural partial ordering. @see{equal-using-type}

PARSE (TYPE E &OPTIONAL CONTEXT)

@arg[type]{an instance of @class{data-type}} @arg[e]{a string} @arg[context]{an instance of @class{validation-context}} @return{an object} @short{Parse string @code{e} and return a representation of its value as defined by the data type.} The @code{context} argument is required if @fun{type-context-dependent-p} is true for @code{type}, and will be ignored otherwise. @see{equal-using-type} @see{validp}

TYPE-CONTEXT-DEPENDENT-P (TYPE)

@arg[type]{an instance of @class{data-type}} @return{a boolean} @short{Return true if parsing and validation of values by this type depends on the validation context.} In this case, the optional @code{context} argument to @fun{parse} and @fun{validp} is required, and an error will be signalled if it is missing. @see{validation-context} @see{type-name} @see{type-library} @see{type-context-dependent-p} @see{type-id-type}

TYPE-ID-TYPE (TYPE)

@arg[type]{an instance of @class{data-type}} @return{one of @code{nil}, @code{:id}, @code{:idref}, or @code{:idrefs}} @short{Returns the @em{ID-type} of @code{type}.} The symbols @code{nil}, @code{:id}, @code{:idref}, or @code{:idrefs} represent the ID-types @em{null}, @em{ID}, @em{IDREF}, and @em{IDREFS}, respectively, as defined by @a[http://relaxng.org/compatibility-20011203.html]{ RELAX NG DTD Compatibility}. @see{type-name} @see{type-library} @see{type-context-dependent-p}

TYPE-LIBRARY (TYPE)

@arg[type]{an instance of @class{data-type}} @return{library name, a keyword} @short{Return the name of the library this type belongs to.} @see{type-name} @see{type-context-dependent-p} @see{type-id-type}

VALIDP (TYPE E &OPTIONAL CONTEXT)

@arg[type]{an instance of @class{data-type}} @arg[e]{a string} @arg[context]{an instance of @class{validation-context}} @return{a boolean} @short{Determine whether a string is a valid lexical representation for a type.} The @code{context} argument is required if @fun{type-context-dependent-p} is true for @code{type}, and will be ignored otherwise. @see{parse} @see{equal-using-type}

Private

Undocumented

DESCRIBE-FACETS (OBJECT STREAM)

LENGTH-USING-TYPE (TYPE U)

MUNGE-WHITESPACE (TYPE E)

PARSE-PARAMETER (CLASS-NAME TYPE-NAME PARAM-NAME VALUE)

PARSE/XSD (TYPE E CONTEXT)

PATTERN-SCANNER (STR)

VALIDP/XSD (TYPE V CONTEXT)

SLOT-ACCESSOR

Public

EXACT-LENGTH (DATA-TYPE)

The @arg[data-type]{a data type supporting restrictions on value lengths} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-length]{length facet}, or @code{nil} if none was specified. @see{min-length} @see{max-length}

SETFEXACT-LENGTH (NEW-VALUE OBJECT)

Set the @arg[data-type]{a data type supporting restrictions on value lengths} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-length]{length facet}, or @code{nil} if none was specified. @see{min-length} @see{max-length}

FRACTION-DIGITS (DATA-TYPE)

The @arg[data-type]{a subtype of @class{decimal-type}} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-fractionDigits]{fractionDigits facet}, or @code{nil} if none was specified. @see{total-digits}

SETFFRACTION-DIGITS (NEW-VALUE OBJECT)

Set the @arg[data-type]{a subtype of @class{decimal-type}} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-fractionDigits]{fractionDigits facet}, or @code{nil} if none was specified. @see{total-digits}

MAX-EXCLUSIVE (DATA-TYPE)

The @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-maxExclusive]{maxExclusive facet}, or @code{nil} if none was specified. @see{min-exclusive} @see{min-inclusive} @see{max-inclusive}

SETFMAX-EXCLUSIVE (NEW-VALUE OBJECT)

Set the @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-maxExclusive]{maxExclusive facet}, or @code{nil} if none was specified. @see{min-exclusive} @see{min-inclusive} @see{max-inclusive}

MAX-INCLUSIVE (DATA-TYPE)

The @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-maxInclusive]{maxInclusive facet}, or @code{nil} if none was specified. @see{min-exclusive} @see{max-exclusive} @see{min-inclusive}

SETFMAX-INCLUSIVE (NEW-VALUE OBJECT)

Set the @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-maxInclusive]{maxInclusive facet}, or @code{nil} if none was specified. @see{min-exclusive} @see{max-exclusive} @see{min-inclusive}

MAX-LENGTH (DATA-TYPE)

The @arg[data-type]{a data type supporting restrictions on value lengths} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-maxLength]{maxLength facet}, or @code{nil} if none was specified. @see{exact-length} @see{min-length}

SETFMAX-LENGTH (NEW-VALUE OBJECT)

Set the @arg[data-type]{a data type supporting restrictions on value lengths} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-maxLength]{maxLength facet}, or @code{nil} if none was specified. @see{exact-length} @see{min-length}

MIN-EXCLUSIVE (DATA-TYPE)

The @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-minExclusive]{minExclusive facet}, or @code{nil} if none was specified. @see{max-exclusive} @see{min-inclusive} @see{max-inclusive}

SETFMIN-EXCLUSIVE (NEW-VALUE OBJECT)

Set the @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-minExclusive]{minExclusive facet}, or @code{nil} if none was specified. @see{max-exclusive} @see{min-inclusive} @see{max-inclusive}

MIN-INCLUSIVE (DATA-TYPE)

The @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-minInclusive]{minInclusive facet}, or @code{nil} if none was specified. @see{min-exclusive} @see{max-exclusive} @see{max-inclusive}

SETFMIN-INCLUSIVE (NEW-VALUE OBJECT)

Set the @arg[data-type]{an ordered data type} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-minInclusive]{minInclusive facet}, or @code{nil} if none was specified. @see{min-exclusive} @see{max-exclusive} @see{max-inclusive}

MIN-LENGTH (DATA-TYPE)

The @arg[data-type]{a data type supporting restrictions on value lengths} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-minLength]{minLength facet}, or @code{nil} if none was specified. @see{exact-length} @see{max-length}

SETFMIN-LENGTH (NEW-VALUE OBJECT)

Set the @arg[data-type]{a data type supporting restrictions on value lengths} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-minLength]{minLength facet}, or @code{nil} if none was specified. @see{exact-length} @see{max-length}

PATTERNS (DATA-TYPE)

The @arg[data-type]{a subtype of @class{xsd-type}} @return{a list of strings} This slot reader returns a list of the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-pattern]{pattern facets}.

SETFPATTERNS (NEWVAL DATA-TYPE)

Set the @arg[data-type]{a subtype of @class{xsd-type}} @return{a list of strings} This slot reader returns a list of the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-pattern]{pattern facets}.

TOTAL-DIGITS (DATA-TYPE)

The @arg[data-type]{a subtype of @class{decimal-type}} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-totalDigits]{totalDigits facet}, or @code{nil} if none was specified. @see{fraction-digits}

SETFTOTAL-DIGITS (NEW-VALUE OBJECT)

Set the @arg[data-type]{a subtype of @class{decimal-type}} @return{an integer, or @code{nil}} This slot reader returns the type's @a[http://www.w3.org/TR/xmlschema-2/#rf-totalDigits]{totalDigits facet}, or @code{nil} if none was specified. @see{fraction-digits}

TYPE-NAME (TYPE)

The @arg[type]{an instance of @class{data-type}} @return{type name, a string} @short{Return the name this type has within its library.} @see{type-library} @see{type-context-dependent-p} @see{type-id-type}

Private

Undocumented

CHAINED-TYPE (OBJECT)

SETFCHAINED-TYPE (NEW-VALUE OBJECT)

COMPILED-PATTERNS (OBJECT)

SETFCOMPILED-PATTERNS (NEW-VALUE OBJECT)

CONTEXT-SOURCE (OBJECT)

SETFCONTEXT-SOURCE (NEW-VALUE OBJECT)

CONTEXT-STACK (OBJECT)

SETFCONTEXT-STACK (NEW-VALUE OBJECT)

UNPARSED-ENTITIES (OBJECT)

SETFUNPARSED-ENTITIES (NEW-VALUE OBJECT)

WORD-TYPE (OBJECT)

VARIABLE

Private

Undocumented

*ID-TYPE*

*IDREF-TYPE*

*IDREFS-TYPE*

*IN-PATTERN-PARSER-P*

*STANDARD-OPTIMIZE-SETTINGS*

*STRING-DATA-TYPE*

*TOKEN-DATA-TYPE*

*WHITESPACE*

*XSD-TYPES*

. (CHARACTER)

\C (CHARACTER)

\D (CHARACTER)

\I (CHARACTER)

\S (CHARACTER)

\W (CHARACTER)

^C (CHARACTER)

^D (CHARACTER)

^I (CHARACTER)

^S (CHARACTER)

^W (CHARACTER)

DOUBLE-FLOAT-NAN

DOUBLE-FLOAT-NEGATIVE-INFINITY

DOUBLE-FLOAT-POSITIVE-INFINITY

p{Cc} (CHARACTER)

p{Cf} (CHARACTER)

p{Cn} (CHARACTER)

p{Co} (CHARACTER)

p{C} (CHARACTER)

p{isAlphabeticPresentationForms} (CHARACTER)

p{isArabicPresentationForms-A} (CHARACTER)

p{isArabicPresentationForms-B} (CHARACTER)

p{isArabic} (CHARACTER)

p{isArmenian} (CHARACTER)

p{isArrows} (CHARACTER)

p{isBasicLatin} (CHARACTER)

p{isBengali} (CHARACTER)

p{isBlockElements} (CHARACTER)

p{isBopomofoExtended} (CHARACTER)

p{isBopomofo} (CHARACTER)

p{isBoxDrawing} (CHARACTER)

p{isBraillePatterns} (CHARACTER)

p{isCherokee} (CHARACTER)

p{isCJKCompatibilityForms} (CHARACTER)

p{isCJKCompatibilityIdeographs} (CHARACTER)

p{isCJKCompatibility} (CHARACTER)

p{isCJKRadicalsSupplement} (CHARACTER)

p{isCJKSymbolsandPunctuation} (CHARACTER)

p{isCJKUnifiedIdeographsExtensionA} (CHARACTER)

p{isCJKUnifiedIdeographs} (CHARACTER)

p{isCombiningDiacriticalMarks} (CHARACTER)

p{isCombiningHalfMarks} (CHARACTER)

p{isCombiningMarksforSymbols} (CHARACTER)

p{isControlPictures} (CHARACTER)

p{isCurrencySymbols} (CHARACTER)

p{isCyrillic} (CHARACTER)

p{isDevanagari} (CHARACTER)

p{isDingbats} (CHARACTER)

p{isEnclosedAlphanumerics} (CHARACTER)

p{isEnclosedCJKLettersandMonths} (CHARACTER)

p{isEthiopic} (CHARACTER)

p{isGeneralPunctuation} (CHARACTER)

p{isGeometricShapes} (CHARACTER)

p{isGeorgian} (CHARACTER)

p{isGreekExtended} (CHARACTER)

p{isGreek} (CHARACTER)

p{isGujarati} (CHARACTER)

p{isGurmukhi} (CHARACTER)

p{isHalfwidthandFullwidthForms} (CHARACTER)

p{isHangulCompatibilityJamo} (CHARACTER)

p{isHangulJamo} (CHARACTER)

p{isHangulSyllables} (CHARACTER)

p{isHebrew} (CHARACTER)

p{isHiragana} (CHARACTER)

p{isIdeographicDescriptionCharacters} (CHARACTER)

p{isIPAExtensions} (CHARACTER)

p{isKanbun} (CHARACTER)

p{isKangxiRadicals} (CHARACTER)

p{isKannada} (CHARACTER)

p{isKatakana} (CHARACTER)

p{isKhmer} (CHARACTER)

p{isLao} (CHARACTER)

p{isLatin-1Supplement} (CHARACTER)

p{isLatinExtended-A} (CHARACTER)

p{isLatinExtended-B} (CHARACTER)

p{isLatinExtendedAdditional} (CHARACTER)

p{isLetterlikeSymbols} (CHARACTER)

p{isMalayalam} (CHARACTER)

p{isMathematicalOperators} (CHARACTER)

p{isMiscellaneousSymbols} (CHARACTER)

p{isMiscellaneousTechnical} (CHARACTER)

p{isMongolian} (CHARACTER)

p{isMyanmar} (CHARACTER)

p{isNumberForms} (CHARACTER)

p{isOgham} (CHARACTER)

p{isOpticalCharacterRecognition} (CHARACTER)

p{isOriya} (CHARACTER)

p{isPrivateUse} (CHARACTER)

p{isRunic} (CHARACTER)

p{isSinhala} (CHARACTER)

p{isSmallFormVariants} (CHARACTER)

p{isSpacingModifierLetters} (CHARACTER)

p{isSpecials} (CHARACTER)

p{isSuperscriptsandSubscripts} (CHARACTER)

p{isSyriac} (CHARACTER)

p{isTamil} (CHARACTER)

p{isTelugu} (CHARACTER)

p{isThaana} (CHARACTER)

p{isThai} (CHARACTER)

p{isTibetan} (CHARACTER)

p{isUnifiedCanadianAboriginalSyllabics} (CHARACTER)

p{isYiRadicals} (CHARACTER)

p{isYiSyllables} (CHARACTER)

p{Ll} (CHARACTER)

p{Lm} (CHARACTER)

p{Lo} (CHARACTER)

p{Lt} (CHARACTER)

p{Lu} (CHARACTER)

p{L} (CHARACTER)

p{Mc} (CHARACTER)

p{Me} (CHARACTER)

p{Mn} (CHARACTER)

p{M} (CHARACTER)

p{Nd} (CHARACTER)

p{Nl} (CHARACTER)

p{No} (CHARACTER)

p{N} (CHARACTER)

p{Pc} (CHARACTER)

p{Pd} (CHARACTER)

p{Pe} (CHARACTER)

p{Pf} (CHARACTER)

p{Pi} (CHARACTER)

p{Po} (CHARACTER)

p{Ps} (CHARACTER)

p{P} (CHARACTER)

p{Sc} (CHARACTER)

p{Sk} (CHARACTER)

p{Sm} (CHARACTER)

p{So} (CHARACTER)

p{S} (CHARACTER)

p{Zl} (CHARACTER)

p{Zp} (CHARACTER)

p{Zs} (CHARACTER)

p{Z} (CHARACTER)

SINGLE-FLOAT-NAN

SINGLE-FLOAT-NEGATIVE-INFINITY

SINGLE-FLOAT-POSITIVE-INFINITY

CLASS

Public

ANY-URI-TYPE

@short{The anyURI data type.} @b{Syntax.} An arbitrary string (!). C.f. the @a[http://www.w3.org/TR/xmlschema-2/#anyURI]{specification}. @b{Implementation.} This type returns a normalized string in which special characters have been escaped. @b{Parameters.} This type allows restrictions on the length of the normalized string through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

BASE64-BINARY-TYPE

@short{The base64Binary data type.} @b{Syntax.} Normal Base64 syntax. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#base64Binary]{specification}. @b{Implementation.} This type returns an @code{(unsigned-byte 8)} vector. @b{Parameters.} This type allows restrictions on the length of the octet vector through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

BOOLEAN-TYPE

@short{The boolean data type.} @b{Syntax.} "1", "0", "true", or "false". C.f. the @a[http://www.w3.org/TR/xmlschema-2/#boolean]{specification}. @b{Implementation.} This type returns @code{t} or @code{nil}. @b{Parameters.} No parameters except for @fun{pattern} are available for this type.

BYTE-TYPE

@short{The byte data type, derived from short.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#byte]{specification}. @b{Restrictions.} This type allows only values from the interval [-128, 127]. @b{Parameters and implementation.} Unchanged from the supertype.

DATA-TYPE

@short{The abstract superclass of all types.} Each type belongs to a datatype library, named by a keyword. In each library, the types are named by strings. @see-constructor{find-type} @see-slot{type-name} @see-slot{type-library} @see-slot{type-context-dependent-p} @see-slot{type-id-type} @see{parse} @see{equal-using-type} @see{lessp-using-type} @see{validp}

DATE-TIME-TYPE

@short{The dateTime data type, representing a moment in time.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#dateTime]{specification}. @b{Implementation.} This type returns lists of the form @code{(year month day hour minute second timezone)}. Each value is an integer, except except for @code{second}, which is a real, and @code{timezone} which is a real or @code{nil}. A @code{timezone} of @code{nil} indicates UTC. @b{Example.} @code{2002-10-10T12:00:00-05:00} maps to @code{(2002 10 10 12 0 0 -5)} @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

DATE-TYPE

@short{The date data type, representing a day of the year.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#date]{specification}. @b{Implementation.} This type returns the same kind of lists as @class{date-time-type}, except that the fields @code{hour}, @code{minute} and @code{second} are filled with dummy values from the Gregorian year AD 1. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

DAY-TYPE

@short{The gDay data type, representing a calendar day.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#gDay]{specification}. @b{Implementation.} This type returns the same kind of lists as @class{date-time-type}, except that the fields @code{year}, @code{month}, @code{hour}, @code{minute} and @code{second} are filled with dummy values from the Gregorian year AD 1. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

DECIMAL-TYPE

@short{The decimal data type.} @b{Syntax.} A rational number, written using an optional decimal point and decimal places. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#decimal]{specification}. @b{Implementation.} This type returns a @code{rational}. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. In addition, the facets @slot{fraction-digits} @slot{total-digits} are recognized.

DOUBLE-TYPE

@short{The double data type.} @b{Syntax.} A floating-point number in a "scientific notation". C.f. the @a[http://www.w3.org/TR/xmlschema-2/#double]{specification}. @b{Implementation.} This type returns a @code{double-float} or, on implementations where Infinity and Nan cannot be represented as such, a special symbol that is treated as if it was Infinity or NaN by the built-in ordering. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}.

DTD-COMPATIBILITY-TYPE

@short{The class of DTD Compatibility data types.} This library contains three types: ID, IDREF, and IDREFS. This type library is named @code{:|http://relaxng.org/ns/compatibility/datatypes/1.0|}.

DURATION-TYPE

@short{The duration data type, representing a duration of time.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#duration]{specification}. @b{Implementation.} This type returns lists of the form @code{(years months days hours minutes seconds)}. Each value can be @code{nil} or a number. All values are integers except for @code{seconds}, which is a real. @b{Example.} @code{P1Y2M3DT10H30M} maps to @code{(1 2 3 10 30 nil)} @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}.

ENTITIES-TYPE

@short{The ENTITIES data type, an enumeration.} @b{Syntax.} A whitespace-separated sequence of @class{entity-type} values, with at least one element. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#ENTITIES]{specification}. @b{Implementation.} This type returns a list of the values as returned by @class{entity-type}. @b{Context dependent.} This type is context dependent and requires the @code{context} argument to @fun{parse} and @fun{validp}. @b{Parameters.} This type allows restrictions on the number of values through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

ENTITY-TYPE

@short{The ENTITY data type, derived from NCName.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#ENTITY]{specification}. @b{Restrictions.} This type restricts its supertype @class{ncname-type} to names that have been declared as unparsed entities in the context. @b{Context dependent.} This type is context dependent and requires the @code{context} argument to @fun{parse} and @fun{validp}. @b{Parameters and implementation.} Unchanged from the supertype.

FLOAT-TYPE

@short{The float data type.} @b{Syntax.} A floating-point number in a "scientific notation". C.f. the @a[http://www.w3.org/TR/xmlschema-2/#float]{specification}. @b{Implementation.} This type returns a @code{single-float} or, on implementations where Infinity and Nan cannot be represented as such, a special symbol that is treated as if it was Infinity or NaN by the built-in ordering. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}.

HEX-BINARY-TYPE

@short{The hexBinary data type.} @b{Syntax.} A sequence of two-digit hexadecimal numbers representing one octet each. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#hexBinary]{specification}. @b{Implementation.} This type returns an @code{(unsigned-byte 8)} vector. @b{Parameters.} This type allows restrictions on the length of the octet vector through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

ID-TYPE

@short{The DTD compatibility 'ID' type.} For this type, @fun{parse} will return the string with leading and trailing whitespace removed. The resulting value must be an NCName. The ID-type of this data type is 'ID', ensuring that each value is only used for one element in a document. @see{xsd-id-type}

IDREF-TYPE

@short{The DTD compatibility 'IDREF' type.} For this type, @fun{parse} will return the string with leading and trailing whitespace removed. The resulting value must be an NCName. The ID-type of this data type is 'IDREF', ensuring that the value referenced must be declared as the ID of an element in the document. @see{xsd-idref-type}

IDREFS-TYPE

@short{The DTD compatibility 'IDREFS' type.} Strings are valid for this data type they contain a whitespace-separated list of one or more NCNames. @fun{parse} will return a list of these substrings. The ID-type of this data type is 'IDREFS', ensuring that each value referenced must be declared as the ID of an element in the document. @see{xsd-idrefs-type}

INT-TYPE

@short{The int data type, derived from long.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#int]{specification}. @b{Restrictions.} This type allows only values from the interval [-2^31, 2^31-1]. @b{Parameters and implementation.} Unchanged from the supertype.

INTEGER-TYPE

@short{The integer data type, derived from decimal.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#integer]{specification}. @b{Syntax.} An integer, written it the decimal system without leading zeros. No decimal point is permitted. @b{Implementation.} This type returns an @code{integer}. @b{Parameters and implementation.} Unchanged from the supertype.

KLACKS-VALIDATION-CONTEXT

A validation-context implementation that queries a klacks source for information about the parser's current state. @see-constructor{make-klacks-validation-context}

LANGUAGE-TYPE

@short{The language data type, derived from token.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#language]{specification}. @b{Restrictions.} This type restricts its supertype @class{token-type} to strings of the pattern "[a-zA-Z]{1,8@}(-[a-zA-Z0-9]{1,8@})*". @b{Parameters and implementation.} Unchanged from the supertype.

LONG-TYPE

@short{The long data type, derived from integer.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#long]{specification}. @b{Restrictions.} This type allows only values from the interval [-2^63, 2^63-1]. @b{Parameters and implementation.} Unchanged from the supertype.

MONTH-DAY-TYPE

@short{The gMonthDay data type, representing a calendar month and day.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#monthDay]{specification}. @b{Implementation.} This type returns the same kind of lists as @class{date-time-type}, except that the fields @code{year}, @code{hour}, @code{minute} and @code{second} are filled with dummy values from the Gregorian year AD 1. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

MONTH-TYPE

@short{The gMonth data type, representing a calendar month.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#gMonth]{specification}. @b{Implementation.} This type returns the same kind of lists as @class{date-time-type}, except that the fields @code{year}, @code{day}, @code{hour}, @code{minute} and @code{second} are filled with dummy values from the Gregorian year AD 1. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

NAME-TYPE

@short{The Name data type, derived from token.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#Name]{specification}. @b{Restrictions.} This type restricts its supertype @class{token-type} to strings of the pattern "\i\c*". @b{Parameters and implementation.} Unchanged from the supertype.

NCNAME-TYPE

@short{The NCName data type, derived from Name.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#NCName]{specification}. @b{Restrictions.} This type restricts its supertype @class{name-type} to strings of the pattern "[\i-[:]][\c-[:]]*". @b{Parameters and implementation.} Unchanged from the supertype.

NEGATIVE-INTEGER-TYPE

@short{The negativeInteger data type, derived from nonPositiveInteger.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#negativeInteger]{specification}. @b{Restrictions.} This type allows only values < 0. @b{Parameters and implementation.} Unchanged from the supertype.

NMTOKEN-TYPE

@short{The NMTOKEN data type, derived from token.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#NMTOKEN]{specification}. @b{Restrictions.} This type restricts its supertype @class{token-type} to strings of the pattern "\c+". @b{Parameters and implementation.} Unchanged from the supertype.

NMTOKENS-TYPE

@short{The NMTOKENS data type, an enumeration.} @b{Syntax.} A whitespace-separated sequence of @class{nmtoken-type} values, with at least one element. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#NMTOKENS]{specification}. @b{Implementation.} This type returns a list of the values as returned by @class{nmtoken-type}. @b{Parameters.} This type allows restrictions on the number of values through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

NON-NEGATIVE-INTEGER-TYPE

@short{The nonNegativeInteger data type, derived from integer.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger]{specification}. @b{Restrictions.} This type allows only values >= 0. @b{Parameters and implementation.} Unchanged from the supertype.

NON-POSITIVE-INTEGER-TYPE

@short{The nonPositiveInteger data type, derived from integer.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger]{specification}. @b{Restrictions.} This type allows only values <= 0. @b{Parameters and implementation.} Unchanged from the supertype.

NORMALIZED-STRING-TYPE

@short{The normalizedString data type, derived from string.} @b{Syntax.} An arbitrary string. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#normalizedString]{specification}. @b{Implementation.} Returns the string with whitespace replaced. I.e., each whitespace character is replaced by a space (character code 32), but multiple spaces, as well as leading and trailing spaces will still be returned. (This is the only XSD type that replaces whitespace in this way.) @b{Parameters.} This type allows restrictions on the length of the normalized string through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

NOTATION-TYPE

@short{The NOTATION data type.} @b{Syntax.} A qualified name. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#NOTATION]{specification}. @b{Implementation.} This type is treated exactly like @class{qname-type}, as specified in @a[http://relaxng.org/xsd-20010907.html]{Guidelines for using W3C XML Schema Datatypes with RELAX NG}. @b{Parameters.} This type allows restrictions on the length of the original QName through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

PARAM

@short{A named data type parameter.} (With the XSD type library, parameters are known as restricting facets.) @see-constructor{make-param} @see{find-type} @see{cxml-rng:pattern-params} @see{cxml-rng:data} @see-slot{param-name} @see-slot{param-value}

POSITIVE-INTEGER-TYPE

@short{The positiveInteger data type, derived from nonNegativeInteger.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#positiveInteger]{specification}. @b{Restrictions.} This type allows only values > 0. @b{Parameters and implementation.} Unchanged from the supertype.

QNAME-TYPE

@short{The QName data type.} @b{Syntax.} A Qualified Name, as per the "Namespaces in XML" specification. The namespace prefix must be bound to a namespace URI in the context. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#QName]{specification}. @b{Context dependent.} This type is context dependent and requires the @code{context} argument to @fun{parse} and @fun{validp}. @b{Implementation.} This type returns a structure with two components, the namespace URI and the local name. fixme: and the original length. fixme: export this structure. @b{Parameters.} This type allows restrictions on the length of the original QName through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

RNG-TYPE

@short{The class of Relax NG built-in types.} Relax NG defines two built-in data type: string and token. The Relax NG type library is named @code{:||}.

SAX-VALIDATION-CONTEXT-MIXIN

@short{A class that implements validation-context as a mixin for user-defined SAX handler classes.} The mixin will record namespace information automatically, and the user's SAX handler can simply be passed as a validation context to data type functions.

SHORT-TYPE

@short{The short data type, derived from int.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#short]{specification}. @b{Restrictions.} This type allows only values from the interval [-2^15, 2^15-1]. @b{Parameters and implementation.} Unchanged from the supertype.

STRING-TYPE

@short{The Relax NG 'string' type.} This data type allows arbitrary strings and interprets them as-is. For this type, @fun{parse} will return any string unchanged, and @fun{equal-using-type} compares strings using @code{equal}.

TIME-TYPE

@short{The time data type, representing a time of day.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#dateTime]{specification}. @b{Implementation.} This type returns the same kind of lists as @class{date-time-type}, except that the fields @code{year}, @code{month} and @code{day} are filled with dummy values from the Gregorian year AD 1. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

TOKEN-TYPE

@short{The Relax NG 'token' type.} This data type allows arbitrary strings and normalizes all whitespaces. For this type, @fun{parse} will return the string with leading and trailing whitespace removed, and remaining sequences of spaces compressed down to one space character each. A method for @fun{equal-using-type} compares strings using @code{equal}.

UNSIGNED-BYTE-TYPE

@short{The unsignedByte data type, derived from unsignedInt.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#unsignedByte]{specification}. @b{Restrictions.} This type allows only values from the interval [0, 255]. @b{Parameters and implementation.} Unchanged from the supertype.

UNSIGNED-INT-TYPE

@short{The unsignedInt data type, derived from unsignedLong.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#unsignedInt]{specification}. @b{Restrictions.} This type allows only values from the interval [0, 2^32-1]. @b{Parameters and implementation.} Unchanged from the supertype.

UNSIGNED-LONG-TYPE

@short{The unsignedLong data type, derived from nonNegativeInteger.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#unsignedLong]{specification}. @b{Restrictions.} This type allows only values from the interval [0, 2^64-1]. @b{Parameters and implementation.} Unchanged from the supertype.

UNSIGNED-SHORT-TYPE

@short{The unsignedShort data type, derived from unsignedInt.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#unsignedShort]{specification}. @b{Restrictions.} This type allows only values from the interval [0, 2^16-1]. @b{Parameters and implementation.} Unchanged from the supertype.

VALIDATION-CONTEXT

@short{This abstract class defines a protocol allowing data types to query the XML parser about its current state.} Some types are context dependent, as indicated by @fun{type-context-dependent-p}. Those types need access to state computed by the XML parser implicitly, like namespace bindings or the Base URI. User-defined subclasses must implement methods for the functions @fun{context-find-namespace-binding} and @fun{context-find-unparsed-entity}. Two pre-defined validation context implementations are provided, one for use with SAX, the other based on Klacks.

XSD-ID-TYPE

@short{The ID data type, derived from NCName.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#ID]{specification}. @b{Restrictions.} None. @b{ID type.} This type has the ID-type 'ID'for the purposes of DTD compatibility. See @a[http://relaxng.org/xsd-20010907.html]{Guidelines for using W3C XML Schema Datatypes with RELAX NG}. @b{Parameters and implementation.} Unchanged from the supertype. @see{id-type}

XSD-IDREF-TYPE

@short{The IDREF data type, derived from ID.} C.f. the @a[http://www.w3.org/TR/xmlschema-2/#IDREF]{specification}. @b{Restrictions.} None. @b{ID type.} This type has the ID-type 'IDREF'for the purposes of DTD compatibility. See @a[http://relaxng.org/xsd-20010907.html]{Guidelines for using W3C XML Schema Datatypes with RELAX NG}. @b{Parameters and implementation.} Unchanged from the supertype. @see{idref-type}

XSD-IDREFS-TYPE

@short{The IDREFS data type, an enumeration.} @b{Syntax.} A whitespace-separated sequence of @class{xsd-idref-type} values, with at least one element. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#IDREFS]{specification}. @b{Implementation.} This type returns a list of the values as returned by @class{xsd-idref-type}. @b{ID type.} This type has the ID-type 'IDREFS'for the purposes of DTD compatibility. See @a[http://relaxng.org/xsd-20010907.html]{Guidelines for using W3C XML Schema Datatypes with RELAX NG}. @b{Parameters.} This type allows restrictions on the number of values through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}. @see{idrefs-type}

XSD-STRING-TYPE

@short{The string data type.} @b{Syntax.} An arbitrary string. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#string]{specification}. @b{Implementation.} Returns the string unchanged. This is the only XSD type that does not normalize or replace whitespace. @b{Parameters.} This type allows restrictions on the length of the string through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

XSD-TOKEN-TYPE

@short{The token data type, derived from normalizedString.} @b{Syntax.} An arbitrary string. C.f. the @a[http://www.w3.org/TR/xmlschema-2/#token]{specification}. @b{Implementation.} Returns the string with normalized whitespace. I.e., each whitespace character is replaced by a space (character code 32), multiple spaces are collapsed into one character, and leading and trailing spaces will be removed. (This is the standard behaviour of all XSD types with the exception of token's supertypes @class{string-type} and @class{normalized-string-type}.) @b{Parameters.} This type allows restrictions on the length of the normalized string through the parameters @slot{exact-length}, @slot{min-length}, and @slot{max-length}.

XSD-TYPE

@short{The class of XML Schema built-in types.} Subclasses of xsd-type provide the built-in types of @a[http://www.w3.org/TR/xmlschema-2/]{ XML Schema Part 2: Datatypes Second Edition} as specified in @a[http://relaxng.org/xsd-20010907.html]{Guidelines for using W3C XML Schema Datatypes with RELAX NG}. The XSD type library is named @code{:|http://www.w3.org/2001/XMLSchema-datatypes|}. @b{Parameters.} All XSD types accept regular expressions restricting the set of strings accepted by the type. The pattern parameter is called @code{"pattern"}. This parameter can be repeated to specify multiple regular expressions that must all match the data. As an initarg, specify @code{:pattern} with a list of regular expressions as an argument. @see-slot{patterns}

YEAR-MONTH-TYPE

@short{The gYearMonth data type, representing the calendar month of a specific year.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#gYearMonth]{specification}. @b{Implementation.} This type returns the same kind of lists as @class{date-time-type}, except that the fields @code{day}, @code{hour}, @code{minute} and @code{second} are filled with dummy values from the Gregorian year AD 1. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

YEAR-TYPE

@short{The gYear data type, representing a calendar year.} @b{Syntax.} This type accepts an ISO-like syntax. For details refer to the @a[http://www.w3.org/TR/xmlschema-2/#gYear]{specification}. @b{Implementation.} This type returns the same kind of lists as @class{date-time-type}, except that the fields @code{month}, @code{day}, @code{hour}, @code{minute} and @code{second} are filled with dummy values from the Gregorian year AD 1. @b{Parameters.} This type is ordered and allows the parameters @slot{max-inclusive}, @slot{min-inclusive}, @slot{max-exclusive}, and @slot{min-exclusive}. The ordering is partial except within a timezone, see the spec for details.

Private

LEXER

LEXER structures are used to hold the regex string which is currently lexed and to keep track of the lexer's state.

Undocumented

ENUMERATION-TYPE

LENGTH-MIXIN

ORDERING-MIXIN

QNAME

QNAME-LIKE

TIME-ORDERING-MIXIN

CONSTANT

Private

Undocumented

+1+

+LIMIT-1+