Module libxml2 :: Class parserCtxt
[hide private]
[frames] | no frames]

Class parserCtxt

source code

parserCtxtCore --+
                 |
                parserCtxt

Instance Methods [hide private]
 
__init__(self, _obj=None) source code
 
__del__(self) source code
 
doc(self)
Get the document tree from a parser context.
source code
 
isValid(self)
Get the validity information from a parser context.
source code
 
lineNumbers(self, linenumbers)
Switch on the generation of line number for elements nodes.
source code
 
loadSubset(self, loadsubset)
Switch the parser to load the DTD without validating.
source code
 
pedantic(self, pedantic)
Switch the parser to be pedantic.
source code
 
replaceEntities(self, replaceEntities)
Switch the parser to replace entities.
source code
 
validate(self, validate)
Switch the parser to validation mode.
source code
 
wellFormed(self)
Get the well formed information from a parser context.
source code
 
htmlCtxtReadDoc(self, cur, URL, encoding, options)
parse an XML in-memory document and build a tree.
source code
 
htmlCtxtReadFd(self, fd, URL, encoding, options)
parse an XML from a file descriptor and build a tree.
source code
 
htmlCtxtReadFile(self, filename, encoding, options)
parse an XML file from the filesystem or the network.
source code
 
htmlCtxtReadMemory(self, buffer, size, URL, encoding, options)
parse an XML in-memory document and build a tree.
source code
 
htmlCtxtReset(self)
Reset a parser context
source code
 
htmlCtxtUseOptions(self, options)
Applies the options to the parser context
source code
 
htmlFreeParserCtxt(self)
Free all the memory used by a parser context.
source code
 
htmlParseCharRef(self)
parse Reference declarations [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
source code
 
htmlParseChunk(self, chunk, size, terminate)
Parse a Chunk of memory
source code
 
htmlParseDocument(self)
parse an HTML document (and build a tree if using the standard SAX interface).
source code
 
htmlParseElement(self)
parse an HTML element, this is highly recursive [39] element ::= EmptyElemTag | STag content ETag [41] Attribute ::= Name Eq AttValue
source code
 
byteConsumed(self)
This function provides the current index of the parser relative to the start of the current entity.
source code
 
clearParserCtxt(self)
Clear (release owned resources) and reinitialize a parser context
source code
 
ctxtReadDoc(self, cur, URL, encoding, options)
parse an XML in-memory document and build a tree.
source code
 
ctxtReadFd(self, fd, URL, encoding, options)
parse an XML from a file descriptor and build a tree.
source code
 
ctxtReadFile(self, filename, encoding, options)
parse an XML file from the filesystem or the network.
source code
 
ctxtReadMemory(self, buffer, size, URL, encoding, options)
parse an XML in-memory document and build a tree.
source code
 
ctxtReset(self)
Reset a parser context
source code
 
ctxtResetPush(self, chunk, size, filename, encoding)
Reset a push parser context
source code
 
ctxtUseOptions(self, options)
Applies the options to the parser context
source code
 
initParserCtxt(self)
Initialize a parser context
source code
 
parseChunk(self, chunk, size, terminate)
Parse a Chunk of memory
source code
 
parseDocument(self)
parse an XML document (and build a tree if using the standard SAX interface).
source code
 
parseExtParsedEnt(self)
parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.
source code
 
setupParserForBuffer(self, buffer, filename)
Setup the parser context to parse a new buffer; Clears any prior contents from the parser context.
source code
 
stopParser(self)
Blocks further parser processing
source code
 
decodeEntities(self, len, what, end, end2, end3)
This function is deprecated, we now always process entities content through xmlStringDecodeEntities TODO: remove it in next major release.
source code
 
handleEntity(self, entity)
Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point.
source code
 
namespaceParseNCName(self)
parse an XML namespace name.
source code
 
namespaceParseNSDef(self)
parse a namespace prefix declaration TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e.
source code
 
nextChar(self)
Skip to the next char input char.
source code
 
parseAttValue(self)
parse a value for an attribute Note: the parser won't do substitution of entities here, this will be handled later in xmlStringGetNodeList [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'" 3.3.3 Attribute-Value Normalization: Before the value of an attribute is passed to the application or checked for validity, the XML processor must normalize it as follows: - a character reference is processed by appending the referenced character to the attribute value - an entity reference is processed by recursively processing the replacement text of the entity - a whitespace character (#x20, #xD, #xA, #x9) is processed by appending #x20 to the normalized value, except that only a single #x20 is appended for a "#xD#xA" sequence that is part of an external parsed entity or the literal entity value of an internal parsed entity - other characters are processed by appending them to the normalized value If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by a single space (#x20) character.
source code
 
parseAttributeListDecl(self)
: parse the Attribute list def for an element [52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>' [53] AttDef ::= S Name S AttType S DefaultDecl
source code
 
parseCDSect(self)
Parse escaped pure raw content.
source code
 
parseCharData(self, cdata)
parse a CharData section.
source code
 
parseCharRef(self)
parse Reference declarations [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' [ WFC: Legal Character ] Characters referred to using character references must match the production for Char.
source code
 
parseComment(self)
Skip an XML (SGML) comment <!-- ....
source code
 
parseContent(self)
Parse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
source code
 
parseDocTypeDecl(self)
parse a DOCTYPE declaration [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '>' [ VC: Root Element Type ] The Name in the document type declaration must match the element type of the root element.
source code
 
parseElement(self)
parse an XML element, this is highly recursive [39] element ::= EmptyElemTag | STag content ETag [ WFC: Element Type Match ] The Name in an element's end-tag must match the element type in the start-tag.
source code
 
parseElementDecl(self)
parse an Element declaration.
source code
 
parseEncName(self)
parse the XML encoding name [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
source code
 
parseEncodingDecl(self)
parse the XML encoding declaration [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'") this setups the conversion filters.
source code
 
parseEndTag(self)
parse an end of tag [42] ETag ::= '</' Name S? '>' With namespace [NS 9] ETag ::= '</' QName S? '>'
source code
 
parseEntityDecl(self)
parse <!ENTITY declarations [70] EntityDecl ::= GEDecl | PEDecl [71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>' [72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>' [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) [74] PEDef ::= EntityValue | ExternalID [76] NDataDecl ::= S 'NDATA' S Name [ VC: Notation Declared ] The Name must match the declared name of a notation.
source code
 
parseEntityRef(self)
parse ENTITY references declarations [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot.
source code
 
parseExternalSubset(self, ExternalID, SystemID)
parse Markup declarations from an external subset [30] extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *
source code
 
parseMarkupDecl(self)
parse Markup declarations [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment [ VC: Proper Declaration/PE Nesting ] Parameter-entity replacement text must be properly nested with markup declarations.
source code
 
parseMisc(self)
parse an XML Misc* optional field.
source code
 
parseName(self)
parse an XML name.
source code
 
parseNamespace(self)
xmlParseNamespace: parse specific PI '<?namespace ...' constructs.
source code
 
parseNmtoken(self)
parse an XML Nmtoken.
source code
 
parseNotationDecl(self)
parse a notation declaration [82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>' Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S SystemLiteral See the NOTE on xmlParseExternalID().
source code
 
parsePEReference(self)
parse PEReference declarations The entity content is handled directly by pushing it's content as a new input stream.
source code
 
parsePI(self)
parse an XML Processing Instruction.
source code
 
parsePITarget(self)
parse the name of a PI [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
source code
 
parsePubidLiteral(self)
parse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
source code
 
parseQuotedString(self)
Parse and return a string between quotes or doublequotes TODO: Deprecated, to be removed at next drop of binary compatibility
source code
 
parseReference(self)
parse and handle entity references in content, depending on the SAX interface, this may end-up in a call to character() if this is a CharRef, a predefined entity, if there is no reference() callback.
source code
 
parseSDDecl(self)
parse the XML standalone declaration [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"')) [ VC: Standalone Document Declaration ] TODO The standalone document declaration must have the value "no" if any external markup declarations contain declarations of: - attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or - entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or - attributes with values subject to normalization, where the attribute appears in the document with a value which will change as a result of normalization, or - element types with element content, if white space occurs directly within any instance of those types.
source code
 
parseStartTag(self)
parse a start of tag either for rule element or EmptyElement.
source code
 
parseSystemLiteral(self)
parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
source code
 
parseTextDecl(self)
parse an XML declaration header for external entities [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' Question: Seems that EncodingDecl is mandatory ? Is that a typo ?
source code
 
parseVersionInfo(self)
parse the XML version.
source code
 
parseVersionNum(self)
parse the XML version value.
source code
 
parseXMLDecl(self)
parse an XML declaration header [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
source code
 
parserHandlePEReference(self)
[69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly.
source code
 
parserHandleReference(self)
TODO: Remove, now deprecated ...
source code
 
popInput(self)
xmlPopInput: the current input pointed by ctxt->input came to an end pop it and return the next char.
source code
 
scanName(self)
Trickery: parse an XML name but without consuming the input flow Needed for rollback cases.
source code
 
skipBlankChars(self)
skip all blanks character found at that point in the input streams.
source code
 
stringDecodeEntities(self, str, what, end, end2, end3)
Takes a entity string content and process to do the adequate substitutions.
source code
 
stringLenDecodeEntities(self, str, len, what, end, end2, end3)
Takes a entity string content and process to do the adequate substitutions.
source code

Inherited from parserCtxtCore: addLocalCatalog, getErrorHandler, setErrorHandler

Method Details [hide private]

__init__(self, _obj=None)
(Constructor)

source code 
Overrides: parserCtxtCore.__init__

__del__(self)
(Destructor)

source code 
Overrides: parserCtxtCore.__del__

htmlCtxtReadDoc(self, cur, URL, encoding, options)

source code 
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context

htmlCtxtReadFd(self, fd, URL, encoding, options)

source code 
parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context

htmlCtxtReadFile(self, filename, encoding, options)

source code 
parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context

htmlCtxtReadMemory(self, buffer, size, URL, encoding, options)

source code 
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context

htmlFreeParserCtxt(self)

source code 
Free all the memory used by a parser context. However the parsed document in ctxt->myDoc is not freed.

byteConsumed(self)

source code 
This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.

ctxtReadDoc(self, cur, URL, encoding, options)

source code 
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context

ctxtReadFd(self, fd, URL, encoding, options)

source code 
parse an XML from a file descriptor and build a tree. This reuses the existing @ctxt parser context NOTE that the file descriptor will not be closed when the reader is closed or reset.

ctxtReadFile(self, filename, encoding, options)

source code 
parse an XML file from the filesystem or the network. This reuses the existing @ctxt parser context

ctxtReadMemory(self, buffer, size, URL, encoding, options)

source code 
parse an XML in-memory document and build a tree. This reuses the existing @ctxt parser context

parseDocument(self)

source code 
parse an XML document (and build a tree if using the standard SAX interface). [1] document ::= prolog element Misc* [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?

parseExtParsedEnt(self)

source code 
parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content

setupParserForBuffer(self, buffer, filename)

source code 
Setup the parser context to parse a new buffer; Clears any prior contents from the parser context. The buffer parameter must not be None, but the filename parameter can be

decodeEntities(self, len, what, end, end2, end3)

source code 
This function is deprecated, we now always process entities content through xmlStringDecodeEntities TODO: remove it in next major release. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'

namespaceParseNCName(self)

source code 
parse an XML namespace name. TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. [NS 3] NCName ::= (Letter | '_') (NCNameChar)* [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender

namespaceParseNSDef(self)

source code 
parse a namespace prefix declaration TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. [NS 1] NSDef ::= PrefixDef Eq SystemLiteral [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?

parseAttValue(self)

source code 
parse a value for an attribute Note: the parser won't do
substitution of entities here, this will be handled later
in xmlStringGetNodeList  [10] AttValue ::= '"' ([^<&"] |
Reference)* '"' | "'" ([^<&'] | Reference)* "'"  3.3.3
Attribute-Value Normalization: Before the value of an
attribute is passed to the application or checked for
validity, the XML processor must normalize it as follows:
- a character reference is processed by appending the
referenced character to the attribute value - an entity
reference is processed by recursively processing the
replacement text of the entity - a whitespace character
(#x20, #xD, #xA, #x9) is processed by appending #x20 to
the normalized value, except that only a single #x20 is
appended for a "#xD#xA" sequence that is part of an
external parsed entity or the literal entity value of an
internal parsed entity - other characters are processed by
appending them to the normalized value If the declared
value is not CDATA, then the XML processor must further
process the normalized attribute value by discarding any
leading and trailing space (#x20) characters, and by
replacing sequences of space (#x20) characters by a single
space (#x20) character. All attributes for which no
declaration has been read should be treated by a
non-validating parser as if declared CDATA. 

parseCDSect(self)

source code 
Parse escaped pure raw content. [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '<![CDATA[' [20] Data ::= (Char* - (Char* ']]>' Char*)) [21] CDEnd ::= ']]>'

parseCharData(self, cdata)

source code 
parse a CharData section. if we are within a CDATA section ']]>' marks an end of section. The right angle bracket (>) may be represented using the string "&gt;", and must, for compatibility, be escaped using "&gt;" or a character reference when it appears in the string "]]>" in content, when that string is not marking the end of a CDATA section. [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)

parseComment(self)

source code 
Skip an XML (SGML) comment <!-- .... --> The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'

parseElementDecl(self)

source code 
parse an Element declaration. [45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [ VC: Unique Element Type Declaration ] No element type may be declared more than once

parseEntityRef(self)

source code 
parse ENTITY references declarations [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot. The declaration of a parameter entity must precede any reference to it. Similarly, the declaration of a general entity must precede any reference to it which appears in a default value in an attribute-list declaration. Note that if entities are declared in the external subset or in external parameter entities, a non-validating processor is not obligated to read and process their declarations; for such documents, the rule that an entity must be declared is a well-formedness constraint only if standalone='yes'. [ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity

parseMarkupDecl(self)

source code 
parse Markup declarations [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment [ VC: Proper Declaration/PE Nesting ] Parameter-entity replacement text must be properly nested with markup declarations. That is to say, if either the first character or the last character of a markup declaration (markupdecl above) is contained in the replacement text for a parameter-entity reference, both must be contained in the same replacement text. [ WFC: PEs in Internal Subset ] In the internal DTD subset, parameter-entity references can occur only where markup declarations can occur, not within markup declarations. (This does not apply to references that occur in external parameter entities or to the external subset.)

parseMisc(self)

source code 
parse an XML Misc* optional field. [27] Misc ::= Comment | PI | S

parseName(self)

source code 
parse an XML name. [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20 Name)*

parseNamespace(self)

source code 
xmlParseNamespace: parse specific PI '<?namespace ...' constructs. This is what the older xml-name Working Draft specified, a bunch of other stuff may still rely on it, so support is still here as if it was declared on the root of the Tree:-( TODO: remove from library To be removed at next drop of binary compatibility

parseNmtoken(self)

source code 
parse an XML Nmtoken. [7] Nmtoken ::= (NameChar)+ [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*

parsePEReference(self)

source code 
parse PEReference declarations The entity content is handled directly by pushing it's content as a new input stream. [69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly. [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it... [ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled.

parsePI(self)

source code 
parse an XML Processing Instruction. [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' The processing is transfered to SAX once parsed.

parseReference(self)

source code 
parse and handle entity references in content, depending on the SAX interface, this may end-up in a call to character() if this is a CharRef, a predefined entity, if there is no reference() callback. or if the parser was asked to switch to that mode. [67] Reference ::= EntityRef | CharRef

parseStartTag(self)

source code 
parse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. [40] STag ::= '<' Name (S Attribute)* S? '>' [ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag. [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' [ WFC: Unique Att Spec ] No attribute name may appear more than once in the same start-tag or empty-element tag. With namespace: [NS 8] STag ::= '<' QName (S Attribute)* S? '>' [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>'

parseVersionInfo(self)

source code 
parse the XML version. [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ") [25] Eq ::= S? '=' S?

parseVersionNum(self)

source code 
parse the XML version value. [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+

parserHandlePEReference(self)

source code 
[69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly. [ WFC: Entity Declared ] In a document without any DTD, a document with only an internal DTD subset which contains no parameter entity references, or a document with "standalone='yes'", ... ... The declaration of a parameter entity must precede any reference to it... [ VC: Entity Declared ] In a document with an external subset or external parameter entities with "standalone='no'", ... ... The declaration of a parameter entity must precede any reference to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled. A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e. - Included in literal in entity values - Included as Parameter Entity reference within DTDs

parserHandleReference(self)

source code 
TODO: Remove, now deprecated ... the test is done directly in the content parsing routines. [67] Reference ::= EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot. [ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc

scanName(self)

source code 
Trickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references. TODO: seems deprecated now, only used in the default part of xmlParserHandleReference [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (S Name)*

skipBlankChars(self)

source code 
skip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point.

stringDecodeEntities(self, str, what, end, end2, end3)

source code 
Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'

stringLenDecodeEntities(self, str, len, what, end, end2, end3)

source code 
Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'