(index ("ssax:xml->sxml" 0) ("ssax:make-parser" 293) ("ssax:warn" 4742) ("xml-token-kind" 5061) ("xml-token-head" 5405) ("html-entity-unicode-chars" 5994))
(def (sig (procedure "(ssax:xml->sxml PORT NAMESPACE-PREFIX-ASSIG)" (id ssax:xml->sxml))) (p "This procedure reads XML data from " (tt "PORT") " and returns an SXML representation. " (tt "NAMESPACE-PREFIX-ASSIG") " is an alist that maps user prefixes (symbols) to namespaces (URI strings)."))
(def (sig (syntax "(ssax:make-parser TAG1 VAL1 [TAG2 VAL2 ...])" (id ssax:make-parser))) (p "Create a custom XML parser instance of the XML parsing framework. This will be a SAX, a DOM or a specialized parser depending on the supplied user-handlers.") (p "The arguments to " (tt "ssax::make-parser") " are symbol-value pairs, interleaved in the argument list. In other words, " (tt "TAG1") ", " (tt "TAG2") " etc are " (b "unquoted") "(!) symbols that identify the type of value that follows the tagsee below for the list of allowed tags.") (p "The output of this macro is a procedure that represents a parser which accepts two arguments, " (tt "PORT") " and " (tt "SEED") ". " (tt "PORT") " is the port from which to read the XML data and " (tt "SEED") " is the initial value of an accumulator that will be passed into the first procedure, where it can be appended to and returned. Then this value will be passed on to the next procedure and so on to eventually obtain a result, in a " (tt "FOLD") "-like fashion.") (p "Given below are tags and signatures of the corresponding values. Not all tags have to be specified. If some are omitted, reasonable defaults will apply. " (tt "SEED") " always represents the current value of the accumulator that will eventually be returned by the parser.") (p (tt "DOCTYPE")) (pre "     procedure PORT DOCNAME SYSTEMID INTERNAL-SUBSET? SEED") (p "If " (tt "INTERNAL-SUBSET?") " is " (tt "#t") ", the current position in the port is right after we have read " (tt "#\\[") " that begins the internal DTD subset. We must finish reading of this subset before we return (or must call " (tt "ssax:skip-internal-dtd") " if we aren't interested in reading it).") (p "The port at exit must be at the first symbol after the whole DOCTYPE declaration. The handler-procedure must generate four values:") (pre "     ELEMS ENTITIES NAMESPACES SEED") (p "See " (tt "xml-decl::elems") " for " (tt "ELEMS") ". It may be " (tt "#f") " to switch off the validation. " (tt "NAMESPACES") " will typically contain user prefixes for selected URI symbols. The default handler-procedure skips the internal subset, if any, and returns " (tt "(values #f '() '() SEED)") ".") (p (tt "UNDECL-ROOT")) (pre "     procedure ELEM-GI SEED") (p "where " (tt "ELEM-GI") " is an " (tt "UNRES-NAME") " of the root element. This procedure is called when an XML document under parsing contains " (i "no") " " (tt "DOCTYPE") " declaration. The handler-procedure, as a DOCTYPE handler procedure above, must generate four values:") (pre "      ELEMS ENTITIES NAMESPACES SEED") (p "The default handler-procedure returns " (tt "(values #f '() '() seed)")) (p (tt "NEW-LEVEL-SEED")) (pre "     procedure ELEM-GI ATTRIBUTES NAMESPACES EXPECTED-CONTENT SEED") (p "where " (tt "ELEM-GI") " is a " (tt "RES-NAME") " of the element about to be processed. This procedure is to generate the seed to be passed to handlers that process the content of the element.") (p (tt "FINISH-ELEMENT")) (pre "     procedure ELEM-GI ATTRIBUTES NAMESPACES PARENT-SEED SEED") (p "This procedure is called when parsing of " (tt "ELEM-GI") " is finished. The " (tt "SEED") " is the result from the last content parser (or from " (tt "new-level-seed") " if the element has the empty content). " (tt "PARENT-SEED") " is the same seed as was passed to " (tt "new-level-seed") ". The procedure is to generate a seed that will be the result of the element parser.") (p (tt "CHAR-DATA-HANDLER")) (pre "     procedure STRING1 STRING2 SEED") (p "The procedure is supposed to handle a chunk of character data " (tt "STRING1") " followed by a chunk of character data " (tt "STRING2") ". " (tt "STRING2") " is a short string, often \"\\n\" and even \"\" Returns a new " (tt "SEED") ".") (p (tt "PI")) (pre "     association-list ((PI-TAG . PI-HANDLER) ...)") (p "where " (tt "PI-TAG") " is the name of the processing instruction and " (tt "PI-HANDLER") " is a procedure " (tt "PORT PI-TAG SEED") ".") (p "The handler should read the rest of the PI from " (tt "PORT") ", up to and including the combination \"" (tt "?>") "\" that terminates the PI. The handler should return a new seed.") (p "One of the " (tt "PI-TAG") "s may be the symbol " (tt "*DEFAULT*") ". The corresponding handler will handle PIs that no other handler will. If the " (tt "*DEFAULT*") " " (tt "PI-TAG") " is not specified, " (tt "ssax:make-pi-parser") " will assume the default handler that skips the body of the PI."))
(def (sig (procedure "(ssax:warn port message . other-messages))" (id ssax:warn))) (p "Prints " (tt "message") " to " (tt "port") ".  Notice that " (tt "port") " is just ignored by the current implementation (" (tt "(current-error-port) is actually used") ".  It's probably there just for API compatibility reasons."))
(def (sig (syntax "(xml-token-kind TOKEN)" (id xml-token-kind))) (p "Returns the " (tt "TAG-KIND") " of the supplied " (tt "TOKEN") ".") (ul (li (tt "TAG-KIND") " A symbol " (tt "'START") ", " (tt "'END") ", " (tt "'PI") ", " (tt "'DECL") ", " (tt "'COMMENT") ", " (tt "'CDSECT") " or " (tt "'ENTITY-REF") " that identifies a markup token.")))
(def (sig (syntax "(xml-token-head TOKEN) => " (id xml-token-head))) (p "Returns the " (tt "UNRES-NAME") " of the supplied " (tt "TOKEN") ". For xml-tokens of kinds " (tt "'COMMENT") " and " (tt "'CDSECT") ", the head is " (tt "#f") ".") (ul (li (tt "UNRES-NAME") " A name (called GI in the XML Recommendation) as given in an xml document for a markup token: start-tag, PI target, attribute name. If a GI is an NCName, " (tt "UNRES-NAME") " is this NCName converted into a Scheme symbol. If a GI is a QName, " (tt "UNRES-NAME") " is a pair of symbols: " (tt "(PREFIX . LOCALPART)") ".")))
(def (sig (constant "html-entity-unicode-chars" (id html-entity-unicode-chars))) (p "An association list mapping named entities to Unicode characters (actually UTF-8 byte strings).  Intended to be used in an ENTITIES context."))
