XmlResolver Class Referenceabstract

#include <Pt/Xml/XmlResolver.h>

Resolves external entities and DTDs. More...

Public Member Functions

virtual ~XmlResolver ()
 Destructor.
 
InputSourceresolveInput (const Pt::String &publicId, const Pt::String &systemId)
 Returns an input source for the given IDs.
 
void releaseInput (InputSource *is)
 Releases an input source resolved by this resolver.
 
TextCodec< Char, char > * resolveEncoding (const ByteorderMark &bom, const XmlDeclaration &decl)
 Returns a text codec for an encoding string. More...
 

Protected Member Functions

 XmlResolver ()
 Default constructor.
 
virtual InputSourceonResolveInput (const Pt::String &publicId, const Pt::String &systemId)=0
 Returns an input source for the given IDs.
 
virtual void onReleaseInput (InputSource *is)=0
 Releases an input source resolved by this resolver.
 
virtual TextCodec< Char, char > * onResolveEncoding (const ByteorderMark &bom, const XmlDeclaration &decl)
 Returns a text codec for an encoding string. More...
 

Detailed Description

The XmlResolver is used, for example by the XmlReader, to resolve external entites by their public or system ID to an input source. All input sources must be released with the same resolver by which they were created. Encoding strings can also be resolved to to text codecs by the standardised encoding names.

Member Function Documentation

◆ resolveEncoding()

TextCodec<Char, char>* resolveEncoding ( const ByteorderMark bom,
const XmlDeclaration decl 
)

The returned codec will be treated like a stream facet by the caller, i.e. it will be deleted if its refcount is 0.

◆ onResolveEncoding()

virtual TextCodec<Char, char>* onResolveEncoding ( const ByteorderMark bom,
const XmlDeclaration decl 
)
protectedvirtual

The returned codec will be treated like a stream facet by the caller, i.e. it will be deleted if its refcount is 0.