|
||
v7.0 introduced a SMIL Parser and Composer API (smiltranslator.lib) dedicated to handling SMIL documents. v7.0S substantially modified this approach to make it more flexible, with the ability to process XML documents for any specified DTD. The original SMIL Parser and Composer API is now deprecated.
The new libraries against which to link are xmldom.lib
,
xmlparser.lib
, and smildtd.lib
. Header file names
change according to a pattern where the initial "md" is replaced by "gm": e.g.
if you previously included mdxmldocument.h
, now include
gmxmldocument.h
.
This remainder of this page documents the changes made in the new API at class and function level.
This new class is an interface from which DTD-specific classes, responsible for validation, are derived.
This is a generic element class and is used to represent all element types in the DOM: previously SMIL-specific element classes were derived from this class and these derived classes had their own hard coded validation checks. This class holds the elements attributes and values in an array and provides getter and setter methods accordingly.
Validation of attribute names and children is done by the element.
The CheckImmediateChildrenL()
and SetAttributeL()
functions use a MXMLDtd
-object owned by the document to
perform DTD specific checks.
Total responsibility for the parsing of XML files has been given to
the parser (CMDXMLParser
), so the following functions have
been removed from this class: ParseStartTagL()
,
ParseAttributes()
, ParseEndTagL()
.
Composition functionality, specifically
ComposeStartTagL()
, has also been removed. However, the composer
now needs to further interrogate the DOM for attribute details, so some
functionality to aid this has been added. The element can now be interrogated
for the number of attributes (NumAttributes()
), and it is also
possible to index into an attribute array and get the attribute details for a
given index.
All classes derived from CMDXMLNode
and
CMDXMLElement
have lost their parsing/composing functions.
The classes affected are CMDXMLCDATASection
,
CMDXMLCharacterData
, CMDXMLComment
,
CMDXMLDocumentElement
,
CMDXMLProcessingInstruction
and
CMDXMLText
.
A pointer to a MXMLDtd
-derived class can be
passed in on construction and is stored by the parser. It creates the document
with a reference to this object.
The parser now has complete responsibility for parsing, so the
functionality previously provided by ParseStartTagL()
,
ParseAttributes()
, and ParseEndTagL()
in the element
class has been transferred into the parser.
The composer now has complete responsibility for composition, so
the functionality previously provided by ComposeStartTagL()
,
ComposeEndTag()
and ComposeL()
in the node class has
been transferred into the composer.
The document now takes a reference to a
MXMLDtd
object. This enables the DOM to carry out DTD
specific validation. ValidElementNameL()
has been added for this
purpose.
Composition of XML files from the DOM is now purely the
responsibility of the composer (CMDXMLComposer
), and so
functions relating to tag composition have been removed from this class.
Specifically, ComposeStartTagL()
, ComposeEndTag()
and
ComposeL()
are no longer available.