|
Introduction
This external-text-entity
rule is used for entities in categories not dealt with by the OmniMark program.
Note that if no file is found for a #charset
or #capacity
entity, the zero-length string is used as replacement text. This provides a default of "all data characters" or "all reference values". No such default is provided for any other entity, including the #syntax
keyword.
external-text-entity (#implied | #dtd | #charset | #capacity | #syntax) local stream file-name do when entity is (system | in-library) do when file "%eq"exists set file-name to "%eq" else repeat over #libpath do when file "%g(#libpath)%eq" exists set file-name to "%g(#libpath)%eq" exit done again done do when file-name is attached output file file-name else put #error "File for " do when entity is (#dtd | #charset | #capacity | #syntax) put #error "%q" put #error " (%g(#doctype))" when entity is #dtd else when entity is general put #error "entity &%q;" else put #error "entity %%%q;" done put #error " with public id%n" _ " public %"%pq%"%n" _ " " when entity is public put #error " does not exist!%n" halt done else when entity is public & #libvalue has key "%pq" do when #libvalue ^ "%pq" is closed output #libvalue ^ "%pq" else put #error "Stream #libvalue for key '%pq' must be " _ "closed before emitting contents.%n" done else when entity is (#charset l #capacity) ; Zero-length entity replacement text. else when entity is public put #error "Public identifier for " do when entity is (#dtd | #charset l #capacity | #syntax) put #error "%q" put #error " (%g(#doctype))" when entity is #dtd else when entity is general put #error "entity &%q;" else put #error "entity %%%q;" done put #error "%n" _ " public%"%pq%"%n" _ " is not in the library rules!%n" halt else do when entity is #dtd put #error "#dtd (%g(#doctype)) " else when entity is general put #error "Entity &%q;" else put #error "Entity %%%q;" done put #error " has neither a system nor a public identifier!%n" halt done
Related Concepts
External entity rules |
---- |