object
Bi-directional XML parser.
John Fletcher; adapted to Logtalk by Paulo Moura.
3.5
2014/11/3
Copyright (C) 2001-2005 Binding Time Limited, Copyright (C) 2005-2013 John Fletcher
This program is offered free of charge, as unsupported source code. You may use it, copy it, distribute it, modify it or sell it without restriction, but entirely at your own risk.
static, context_switching_calls
(no dependencies on other files)
Parses Chars to/from a data structure of the form xml(<atts>, <content>).
static
parse(Chars,Document)
parse(+nonvar,?nonvar) – zero_or_one
parse(?nonvar,+nonvar) – zero_or_one
Parses Chars to/from a data structure of the form xml(<atts>, <content>).
static
parse(Controls,Chars,Document)
parse(+nonvar,+nonvar,?nonvar) – zero_or_one
parse(+nonvar,?nonvar,+nonvar) – zero_or_one
Unifies Subterm with a sub-term of XMLTerm. Note that XMLTerm is a sub-term of itself.
static
subterm(XMLTerm,Subterm)
subterm(+nonvar,?nonvar) – zero_or_one
Pretty prints a XML document on the current output stream.
static
pp(XMLDocument)
pp(+nonvar) – zero_or_one
(none)
Translates the list of character codes XML into the Prolog term Document. Controls is a list of terms controlling the treatment of layout characters and character entities.
static
xml_to_document(Controls,XML,Document)
xml_to_document(+nonvar,+nonvar,?nonvar) – zero_or_one
True if Map is a null map.
static
empty_map(Map)
empty_map(?nonvar) – zero_or_one
True if Map is a ordered map structure which records the pair Key-Data. Key must be ground.
static
map_member(Key,Map,Data)
map_member(+nonvar,+nonvar,?nonvar) – zero_or_one
True if Map0 is an ordered map structure, Key must be ground, and Map1 is identical to Map0 except that the pair Key-Data is recorded by Map1.
static
map_store(Map0,Key,Data,Map1)
map_store(+nonvar,+nonvar,+nonvar,?nonvar) – zero_or_one
Prints String onto the current output stream. If String contains only 7-bit chars it is printed in shorthand quoted format, otherwise it is written as a list.
static
pp_string(String)
pp_string(+nonvar) – zero_or_one
Identifies SubTerm as a sub-term of Term which cannot be serialized after Indentation. Message is an atom naming the type of error; Path is a string encoding a list of SubTerm's ancestor elements in the form <tag>{(id)}* where <tag> is the element tag and <id> is the value of any attribute _named_ id.
static
fault(Term,Indentation,SubTerm,Path,Message)
fault(+nonvar,+nonvar,?nonvar,?nonvar,?nonvar) – zero_or_one
Hook to raise an exception to be raised in respect of a fault in the XML Term: Document.
static
exception(Message,Document,Culprit,Path)
exception(+atom,+nonvar,+nonvar,+nonvar) – one
DCG generating Document as a list of character codes. Format is true|false defining whether layouts, to provide indentation, should be added between the element content of the resultant "string". Note that formatting is disabled for elements that are interspersed with pcdata/1 terms, such as XHTML's 'inline' elements. Also, Format is over-ridden, for an individual element, by an explicit 'xml:space'="preserve" attribute.
static
document_generation(Format,Document)
Represents the ascii character set in its simplest format, using the character entities & " < and > which are common to both XML and HTML. The numeric entity ' is used in place of ', because browsers don't recognize it in HTML.
static
pcdata_7bit(Char)
Holds when Format0 and Format1 are the statuses of XML formatting before and after Chars - which may be null.
static
character_data_format(Chars,Format0,Format1)
character_data_format(+nonvar,+nonvar,?nonvar) – zero_or_one
Holds when Format0 and Format1 are the statuses of XML formatting before and after Chars - which may be null.
static
cdata_generation(Chars)