|
CLASS moXML_Basic
NAME
Constructor - creates a new XML basic object
Destructor - cleans up an XML basic object
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic(void);
virtual ~moXML_Basic();
DESCRIPTION
The moXML_Basic object implements the basic functions to
handle variables and other basic functions such as include
and basic expressions.
SEE ALSO
moXMLParser
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic
NAME
Attach - attaches basic XML functionality to the specified XML parser
VERSION
Version: 1.2.0
SYNOPSIS
void Attach(moXMLParser& xml);
DESCRIPTION
To use the functions that the moXML_Basic object implements one needs
to call this Attach() function.
SEE ALSO
moXMLParser
BUGS
At this time there is no way to detach an XML extension.
If you destroy this object, you need to make sure that the
ReadNext() from the moXMLParser won't be used anymore.
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic
NAME
AddIncludePath -- add one include path for the mo:include instruction
AppendIncludePath -- add a list of paths for the mo:include instruction
VERSION
Version: 1.2.0
SYNOPSIS
void AddIncludePath(const moWCString& path);
void AppendIncludePath(const moListBase& paths);
DESCRIPTION
The AddIncludePath() function adds one path to the list of
include paths to use to load files via the mo:include instruction.
The AppendIncludePath() function adds all the paths defined in
the specified list to the list of include paths to use to load
files via the mo:include instruction.
As many paths as you want can be added. Any one path is never added
more than once in the list (it wouldn't be very useful). The order
counts since the files are searched in order in the speciied list
of files.
SEE ALSO
moXMLParser
BUGS
At this time you can't remove paths from the list.
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Elif
NAME
Constructor - creates the XML basic Elif object
Destructor - cleans up the XML basic Elif object
OnEvent - catch the tags mo:elif
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Elif(moXML_Basic_If& basic_if);
virtual ~moXML_Basic_Elif();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
PARAMETERS
basic_if - a reference to the basic_if object
parser - the XML parser which found this tag
type - the last object read by the XML parser
DESCRIPTION
The moXML_Basic_Elif object implements the mo:elif function
if a conditional block. It has to appear inside a conditional
block and needs to be an empty tag.
Like the mo:if it needs to include a condition.
Please, see the moXML_Basic_If for more information.
RETURN VALUE
The OnEvent() function will return true whenever the set tag
is valid.
SEE ALSO
moXML_Basic_If, moXML_Basic_ElsIf, moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Else
NAME
Constructor - creates the XML basic Else object
Destructor - cleans up the XML basic Else object
OnEvent - catch the tags mo:else
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Else(moXML_Basic_If& basic_if);
virtual ~moXML_Basic_Else();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
PARAMETERS
basic_if - a reference to the basic_if object
parser - the XML parser which found this tag
type - the last object read by the XML parser
DESCRIPTION
The moXML_Basic_Else object implements the mo:else function
of a conditional block. It has to appear inside a conditional
block and needs to be an empty tag.
The else must be used by itself.
Please, see the moXML_Basic_If for more information.
RETURN VALUE
The OnEvent() function will return true whenever the set tag
is valid.
SEE ALSO
moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Elsif
NAME
Constructor - creates the XML basic Elsif object
Destructor - cleans up the XML basic Elsif object
OnEvent - catch the tags mo:elsif
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Elsif(moXML_Basic_If& basic_if);
virtual ~moXML_Basic_Elsif();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
PARAMETERS
basic_if - a reference to the basic_if object
parser - the XML parser which found this tag
type - the last object read by the XML parser
DESCRIPTION
The moXML_Basic_Elsif object implements the mo:elsif function
of a conditional block. It has to appear inside a conditional
block and needs to be an empty tag.
Like the mo:if it needs to include a condition.
Please, see the moXML_Basic_If for more information.
RETURN VALUE
The OnEvent() function will return true whenever the set tag
is valid.
SEE ALSO
moXML_Basic_If, moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_If
NAME
Constructor - creates the XML basic If object
Destructor - cleans up the XML basic If object
OnEvent - catch the tags mo:if
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_If(void);
virtual ~moXML_Basic_If();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
bool GetCond(moXMLParser& parser, moXMLParser::moXMLType& type, bool& result);
bool SkipFalse(moXMLParser& parser, moXMLParser::moXMLTag& tag, bool maybe);
PARAMETERS
parser - the XML parser calling these functions
type - an XML object
result - the result of the conditional expression
maybe - whether an else, elsif or elif can still react (when true it can)
DESCRIPTION
The moXML_Basic_If object implements the mo:if function
used to insert some code conditionally.
It is linked to the mo:else, mo:elsif, mo:elif and mo:endif
which all are used to change the current state of a conditional
block.
The mo:if, mo:elsif and mo:elif use the following parameters:
cond="<expression>"
is_empty="<string>"
is_not_empty="<string>"
The condition parameter expects an expression which is
either 'true', 'false', '0' or '1'. Any other value will
make the parser generate an error.
An mo:if can be an empty tag in which case it will use the
data parameter and insert its content if the condition is
true:
data="<string>"
When it isn't empty it must be terminated properly and it
can include else statements as described below.
The mo:else will invert the current status from false to
true if it had never been true. The mo:elsif and mo:elif have
exactly the same semantic, they are just spelled differently.
These accept a condition and if that condition is true, it
has the same effect as the mo:else (i.e. it changes the
current status to true if the condition was satisified and
the status has never been true). These three tags must be
empty tags.
The </mo:if> tag terminates an if block.
mo:if blocks can be nested as many times as necessary.
RETURN VALUE
The OnEvent() function will return true whenever the set tag
is valid.
SEE ALSO
moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Include
NAME
Constructor -- creates the XML basic Set object
Destructor -- cleans up the XML basic Set object
OnEvent -- catch the tags mo:include
AddIncludePath -- add one path to the list of paths to check for the input file
AppendIncludePath -- append a list of include paths
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Include(void);
virtual ~moXML_Basic_Include();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
void AddIncludePath(const moWCString& path);
void AppendIncludePath(const moListBase& path);
DESCRIPTION
The moXML_Basic_Include object implements the mo:include function
used to include the content of an external file in place of this tag.
An mo:include tag must be empty.
The mo:include tag accepts two parameters:
src="<filename>" the name of the file to be included
instead of this tag
mode="error" if the file doesn't exist, generate
an error; this is the default
mode="warn" if the file doesn't exist, generate
a warning only
mode="quiet" if the file doesn't exist, just ignore
this tag
RETURN VALUE
The OnEvent() function will return true whenever the include tag
is valid (i.e. either the specified file exists or the mode is
set to something else than "error").
SEE ALSO
moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Insert
NAME
Constructor - creates the XML basic Set object
Destructor - cleans up the XML basic Set object
OnEvent - catch the tags mo:insert
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Insert(void);
virtual ~moXML_Basic_Insert();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
DESCRIPTION
The moXML_Basic_Insert object implements the mo:insert function
used to insert the content of a variable in place of this tag.
An mo:insert tag must be empty.
This function understand the following parameters:
name="<variable name>" the name of the variable
to be inserted in place
RETURN VALUE
The OnEvent() function will return true whenever the insert tag
is valid.
SEE ALSO
moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Loop
NAME
Constructor - creates the XML basic Loop object
Destructor - cleans up the XML basic Loop object
OnEvent - catch the tags mo:loop
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Loop(void);
virtual ~moXML_Basic_Loop();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
PARAMETERS
parser - the XML parser which found this tag
type - the last object read by the XML parser
DESCRIPTION
The moXML_Basic_Loop object implements the mo:loop function.
A loop can be an empty tag in which case it needs to have
a 'data' parameter with the content to be repeated. All the
supported parameters are:
from start counter value; if 'to' is
defined, but not 'from', 'from' is
set to 'to'; this makes the loop
run only once
to end counter value; if not defined,
the from/to can't break the loop
step value used to increment or decrement
the value 'from' until it reaches 'to'
this defaults to 1.0 when 'to' is
larger than 'from' and -1.0 when
'from' is larger than 'to'
repeat maximum number of times to repeat;
inifinite when undefined
separators one or more separator defined in a
string (default to " "); used with
the 'foreach'
foreach execute for each word seperated by
a space or the specified separators
while execute as long as this expression
is true (tested on entry)
until execute as long as this expression
is false (not tested on entry)
name the name of the variable to use to
save the counter, repeat count and
current word defined as:
<name>_index (from value)
<name>_count (repeat count)
<name>_word (foreach word)
data loop on 'data' when the loop tag is
empty
NOTES
At this time the while & until can be used with a variable
which wasn't reduced. This is the only way to use these
parameters. The followings is an example of how to do this:
1. set a variable named 'when' to the value '&x24;(test)';
value which will stay defined as is.
<mo:set name="when" keep_vars="true">&x24;(test)</mo:set>
2. set a startup value in the referenced variable (here 'test')
this value could be computed; it is valid to try to start
the loop with a result of false (in which case the content
of the entire loop will be ignored)
<mo:set name="test" value="true"/>
3. start the loop with a counter ('from' defined, but no upper
limit or maximum count); the 'while' parameter references
the first variable we defined ('when')
<mo:loop name="idx" from="1" while="&x24;(when)">
4. within the loop, we change the value of the 'test' variable;
whenever it becomes false, the loop breaks; here the loop
will be repeated at most 3 times (note that such a simple
test can be archieved with the 'repeat' parameter set to
3, but for the sake of simplicity of this example...)
<mo:set name="test" value="&x24;(expr &x24;(idx_count) < 3)"/>
5. end the loop
</mo:loop>
If this gets fixed, the value of the 'while' parameter will
become the actual expression.
RETURN VALUE
The OnEvent() function will return true whenever the loop tag
is valid.
SEE ALSO
moXML_Basic
BUGS
In order to make the loop work with the XML parser as defined
it needs to add an <mo:loop> tag in a sub-set of the loop.
This tag is given one attribute named 'ignore' and given the
value 'true'. If this attribute appears in the user tag, then
the loop will fail.
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Set
NAME
Constructor - creates the XML basic Set object
Destructor - cleans up the XML basic Set object
OnEvent - catch the tags mo:set
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Set(void);
virtual ~moXML_Basic_Set();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
DESCRIPTION
The moXML_Basic_Set object implements the mo:set function
used to set a variable value.
Note that the mo:set tag can be used with either an empty tag
or a block of data between a start and end tag.
In case of an empty tag, the tag should have a name and
value.
RETURN VALUE
The OnEvent() function will return true whenever the set tag
is valid.
SEE ALSO
moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Unset
NAME
Constructor - creates the XML basic Set object
Destructor - cleans up the XML basic Set object
OnEvent - catch the tags mo:unset
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Unset(void);
virtual ~moXML_Basic_Unset();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
DESCRIPTION
The moXML_Basic_Unset object implements the mo:unset function
used to unset (delete, clear) a variable and its value.
An mo:unset tag must be empty.
RETURN VALUE
The OnEvent() function will return true whenever the unset tag
is valid.
SEE ALSO
moXML_Basic
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
CLASS
moXML_Basic::moXML_Basic_Replace
NAME
Constructor - creates a new XML parser extension object
Destructor - cleans up an XML parser extension object
OnEvent - execute an event that this extension understands
VERSION
Version: 1.2.0
SYNOPSIS
moXML_Basic_Replace(void);
virtual ~moXML_Basic_Replace();
bool OnEvent(moXMLParser& parser, moXMLParser::moXMLType& type);
PARAMETERS
parser - the XML parser
type - the type of the tag being passed in
DESCRIPTION
The <mo:replace ...> tag will ensure that the specified variable
can be used as a string in a script or as the value of a tag do
not include character which will break the script or tag.
The attribute 'name' is used to know which variable is to be acted
on.
Since the function could be wrongly used on undefined variables,
this instruction will generate an error by default. To avoid the
error, defined the 'undefined' attribute and set it to "no-error".
If the attribute format is specified, then it is used to know what
characters the user wants to transform. The string is composed of
characters as follow:
= apply all the previous formats
a replace ampersands (&) with &
b double blackslashes (\ becomes \\)
c remove double spaces (tabs, spaces, etc.)
C remove new lines and carriage return characters
d replace double quotes (") with "
g replace greater than sign (>) with >
l replace smaller than sign (<) with <
n replace new lines (0x0A and/or 0x0D) with \n
q precede single (') and double (") quotes with a backslash (\)
Q like q, but put three backslashes instead of just one (i.e. \\\' and \\\")
s replace single quotes (') with '
v assume that the input is XML (reduce variables and mo tags, remove comments)
V assume that the input is XML (like 'v', but keep the comments)
WARNING: whenever you specify 'v' or 'V', the reduction specified
so far applies; otherwise, doubling a character format has
absolutly no effect so "Q" and "QQ" have the same effect;
if you need to double a format, use an equal sign as in:
"Q=Q" (Q is applied twice).
If the format parameter is not specified, then the default is:
"adglns"
Note that the character 'v' is very special in that it will be
executed at the time it is found in the string. The exact algorithm
is like this:
read format character
if 'v' then
execute all replacements found so far
and execute the 'v' command
repeat until the end of the format string is reached
execute the remaining replacements found
SEE ALSO
moXMLParser::moXMLEvent
COPYRIGHTS
This documentation and the code being documented is proprietary and cannot be duplicated without the express and written consent of Made to Order Software Coporation.
Copyright (c) 1999-2007 by Made to Order Software Corporation
All rights reserved.
AUTHORS
Alexis Wilke, Doug Barbieri
Links:
molib
the sandbox
|