<mmxml> Reference
NOTE: The information in this section will be most useful to advanced MindModel users.
This section provides a complete reference for the <mmxml> language.
Before reading this section, you will probably want to read the section: Key Concepts: XML Templates.
The difference between these two section is as follows:
1) Key Concepts: XML Templates
This section provides an introduction to the way XML is used in MindModel. This section works through a simple example of how to use <mmxml> to customize the Noun Summary Window.
2) Key Concepts: <mmxml> Reference
This section (the one you are reading now) provides descriptions of all of the <mmxml> operators.
Before reading this section, you should have read Key Concepts: XML Templates and should be comfortable with the concepts discussed there.
As always, do your homework, but contact us if you get stuck.
The following <mmxml> operators are defined in this section:
What is <mmxml>?
The <mmxml> language is an XML language that is used to create XML Templates and other customization features of MindModel.
An XML Template is simply a file that contains <mmxml>.
For information on XML Templates, refer to the section: Key Concepts: XML Template. The section on XML Templates also contains a description of what XML is, how it relates to MindModel, and how to use it to customize your models, create reports, etc.
Why would I need to us <mmxml>?
You can use <mmxml> and XML Templates to:
1) Customize the Noun Summary Window.
2) Create reports with these commands:
Reports Menu: Create Report for Selected Noun from XML Template
Reports Menu: Create Report for Nouns in the Nouns List from XML Template
3) Print custom mailing labels using:
Reports Menu: Mailing Labels via XML Template
4) Send customized emails using these commands:
Email Menu: Send Email to Members of a Collection via Outlook
Email Menu: Send Email to Members of a Collection via SMTP
5) Create your own checklist templates for this command:
Nouns Menu: Add Statement for Selected Noun via Checklist
6) Create Model Summary Window Templates (MSWT's) to customize the Model Summary Window.
The Model Summary Window is a very powerful MindModel feature that can display reports with a wide variety of formats and contents.
XML Rules
The <mmxml> language is an XML language. As such, it follows XML rules.
Specifically, <mmxml> follows these two rules:
1) All nested elements must be properly nested
so:
<a>parent<b>child</b></a>
is acceptable
but:
<a>parent<b>child</a></b>
is not.
2) Case matters
so:
<a>parent</a>
is not the same as:
<A>parent</A>
The Structure of an <mmxml> Element
The most common type of <mmxml> element is one used as an XML Template.
XML Templates are used to customize MindModel features (such as the Noun Summary Window) or to create reports.
The structure of this type of <mmxml> element is as follows:
<mmxml>
<definition>
<name>function1</name>
(more function1 elements here)
</definition>
<definition>
<name>function2</name>
(more function2 elements here)
</definition>
<value>
(the value element goes here)
</value>
</mmxml>
In a real <mmxml> element, the parenthesized text "(more function1 elements here)" would be replaced by additional elements, which will be explained later in this section.
So an <mmxml> element contains zero or more <definition> elements, followed by at least one <value> element.
The <definition> Element
The purpose of a <definition> element is to define a function which you can refer to later in the <mmxml> element.
Creating <definition> elements makes it easy for you to create a set of functions that you can combine to create reports.
For example, you could create a <definition> element that returns a person's social security number. You could create another <definition> element that returns a person's zip code. If you wanted to create a report showing a person's social security number and zip code, you would include both of those <definition> elements in an <mmxml> element, along with one <value> element that calls those two function.
The <value> Element
As you noticed from the previous section, the <definition> element is used to define functions. The <value> element can be used to call functions. By "calling a function" we mean referring to the function by name, and having the function's result appear as the result of the <value> element.
So the <mmxml> element for the example we discussed above would look like this:
<mmxml>
<definition>
<name>personSSN</name>
<operator>statementNoun</operator>
<anchor>subject</anchor>
<target>object</target>
<statementPattern>person|has the social security number|social security number</statementPattern>
<before>Social security number:#nbsp#</before>
<after>#newline#</after>
</definition>
<definition>
<name>personZip</name>
<operator>statementNoun</operator>
<anchor>subject</anchor>
<target>object</target>
<statementPattern>person|has the business zip code|zip/postal code</statementPattern>
<before>Zip code:#nbsp#</before>
<after>#newline#</after>
</definition>
<value>
<operator>nounName</operator>
<after>#newline#</after>
<value>
<value>
<operator>definedInXML</operator>
<name>personSSN</name>
<value>
<value>
<operator>definedInXML</operator>
<name>personZip</name>
<value>
<mmxml>
The result of this <mmxml> element would be something like:
John Doe
Zip code: 02134
Social security number: 123-45-6789
If you look back to the <mmxml> code above, you'll see that we introduced a few new elements.
The "<operator>statementNoun</operator>" element tells MindModel to read a noun from a statement in the model.
The "<anchor>subject</anchor>" element tells MindModel that the current noun (in this case, John Doe) is the subject of the statement we want to find.
The "<target>object</target>" element tells MindModel that the noun we want to read from the statement is the object of the statement we want to find.
In this case, the statement is "person|John Doe|has the social security number|social security number|123-45-6789".
The "<statementPattern>person|has the social security number|social security number</statementPattern>" element tells MindModel the statement type of the statement we want to find.
The "<before>Social security number:#nbsp#</before>" tells MindModel to place the words "Social security number: " before the social security number.
The "#nbsp#" tells MindModel to add a space. We can't just put a space in the <before> element, because XML ignores spaces at the end of element values.
The "<after>#newline#</after>" element tells MindModel to add a new line character after the social security number. If we didn't do this, the next item would appear on the same line.
Too Much Too Soon?
If the previous section left you dazed and confused, you may want to read through the section: Key Concepts: XML Templates before reading this one. The other section spends more time introducing and explaining the basic concepts behind <mmxml>.
Back to our Example
Looking back at the example code above, we see that the "personZip" function is pretty much the same thing as the "personSSN" function, except with certain elements changed so it returns social security numbers instead of zip codes.
So if you understand the "personZip" function, you can write a <definition> of a function to return any object noun related to the current noun. Remember, an object noun is a noun in the noun directly after the verb in a statement.
<operator>nounName</operator>
Moving on, we see this code:
<value>
<operator>nounName</operator>
<after>#newline#</after>
<value>
The "<operator>nounName</operator>" element tells MindModel to return the name of the current noun, in our case "John Doe".
<operator>definedInXML</operator>
<value>
<operator>definedInXML</operator>
<name>personSSN</name>
<value>
The "<operator>definedInXML</operator>" tells MindModel to call the named function (in our case "personSSN") and return its value.
The next <definition> element (personZip) is similar to personSSN, but personZip returns a zip code rather than a social security number.
That's it for our basic example.
We've seen that an <mmxml> element contains zero or more definition elements, followed by one or more <value> elements.
The rest of this section contains concise explanations of all the possible values of the <operator> element, which we call "operators".
So far, we've seen the following operators:
definedInXML
nounName
If you need more information than we provide here, please feel free to contact us.
The <mmxml> Operators
Purpose: This operator allows you to specify a set of values, then output each of those values, one after the other.
This operator is most useful when at least some of the values are functions.
For example, you could write a function that outputs contact info for a person.
Example
<value>
<operator>concatenate</operator>
<value>
<operator>nounName</operator>
<after>#newline#</after>
</value>
<value>
<name>bizPhone</name>
<operator>definedInXML</operator>
<before>phone:#nbsp#</before>
<after>#newline#</after>
</value>
<value>
<name>email</name>
<operator>definedInXML</operator>
<before>email:#nbsp#</before>
<after>#newline#</after>
</value>
</value>
If you'd like an in-depth explanation of the use of the "concatenate" operator, refer to the section: Key Concepts: XML Template.
Purpose: This operator allows you to call a function previously defined with a <definition> element.
Example
<value>
<operator>definedInXML</operator>
<name>personSSN</name>
<value>
Purpose: This operator allows you to specify a set of values, then output the first of those values that is not blank.
This operator is most useful when the values are functions.
For example, you could write a function that returns a business address, and one that returns a home address.
Then you could write a function, called "address" that returned the business address if there is one, or if not, returns the home address.
Example
<value>
<operator>firstNonBlank</operator>
<value>
<operator>definedInXML</operator>
<name>bizAddress</name>
</value>
<value>
<operator>definedInXML</operator>
<name>homeAddress</name>
</value>
<value>
The definitions of bizAddress and homeAddress are too long to include here. If you'd like us to email them to you, please feel free to contact us.
Purpose: This operator allows you to specify a set of values, then output the first of those values that is not zero.
This operator is most useful when the values are functions.
You probably won't need this operator, but there are situations in which it is useful.
For example, let's say you're designing an XML Template that you'll use to customize the Noun Summary Window.
The XML Template will allow you to click on a product, then see a summary of the product, including the product's total cost.
Your model is set up so that some products have a price directly associated with the product, using a statement of the type:
product|has the price|dollar amount
Other products don't have a prices directly associated with them, but these products have statements of the type:
product|contains|product
which indicate the products out of which the selected product are made. These parts products, in turn, have statements indicating their price.
So you could write a function that computed displayed the total cost of a product like so:
Example
<value>
<name>costOfProduct</name>
<operator>firstNonZero</operator>
<value>
<name>productCostsDollarObject</name>
<operator>definedInXML</operator>
</value>
<value>
<name>costOfContainedProducts</name>
<operator>definedInXML</operator>
</value>
</value>
The definitions of productCostsDollarObject and costOfContainedProducts are too long to include here. If you'd like us to email them to you, please feel free to contact us.
Purpose: This operator returns the name of the current noun.
Example
<value>
<operator>nounName</operator>
<before>Name:#nbsp#</before>
<after>#newline#</after>
<value>
Elements
<before>
The <before> element indicates text to be output before the noun name.
<after>
The <after> element indicates text to be output after the noun name.
Purpose: This operator returns a noun read from the specified statement.
Example
<value>
<operator>statementNoun</operator>
<anchor>subject</anchor>
<target>object</target>
<statementPattern>person|has the social security number|social security number</statementPattern>
<before>Social security number:#nbsp#</before>
<after>#newline#</after>
</value>
Elements
<before>
The <before> element indicates text to be output before the noun name.
<after>
The <after> element indicates text to be output after the noun name.
<anchor>
The <anchor> element indicates the place in the statement where the current noun is found.
Possible <anchor> elements are:
<anchor>subject</anchor>
<anchor>object</anchor>
<anchor>object of preposition</anchor>
You can only use one of these <anchor> elements in a statementNoun element.
<target>
The <target> element indicates the place in the statement where the noun to be returned is found.
Possible <target> elements are:
<target>subject</target>
<target>object</target>
<target>object of preposition</target>
You can only use one of these <target> elements in a statementNoun element.
The <anchor> and <target> elements work together.
A common combination is:
<anchor>subject</anchor>
<target>object</target>
which would mean that the current noun is the subject of the statement, and the target noun is the object.
<statementPattern>
The statementPattern indicates the statement type of the statement containing the anchor and target nouns.
The parts of the statement pattern are separated by vertical bars ("|").
Purpose: This operator returns a list of noun names read from specified statements.
statementNounList is similar to statementNoun, except that statementNounList returns more than one noun, and statementNoun returns one noun.
Since statementNounList returns a list of noun names, it uses additional elements (<between>, <beforeEach>, <afterEach>) to specify attributes of the list.
Example
<value>
<operator>statementNounList</operator>
<anchor>subject</anchor>
<target>object</target>
<statementPattern>person|has the skill|skill</statementPattern>
<before>Skills:#nbsp#</before>
<between>,#nbsp#<between>
<after>.</after>
</value>
Output: Skills: auto repair, blackjack, cooking.
Elements
<anchor>
The <anchor> element indicates the place in the statement where the current noun is found.
Possible <anchor> elements are:
<anchor>subject</anchor>
<anchor>object</anchor>
<anchor>object of preposition</anchor>
You can only use one of these <anchor> elements in a statementNoun element.
<target>
The <target> element indicates the place in the statement where the noun to be returned is found.
Possible <target> elements are:
<target>subject</target>
<target>object</target>
<target>object of preposition</target>
You can only use one of these <target> elements in a statementNoun element.
The <anchor> and <target> elements work together.
A common combination is:
<anchor>subject</anchor>
<target>object</target>
which would mean that the current noun is the subject of the statement, and the target noun is the object.
<statementPattern>
The statementPattern indicates the statement type of the statement containing the target nouns.
The parts of the statement pattern are separated by vertical bars ("|").
<before>
The <before> element specifies text to be output before the list of noun names.
<after>
The <after> element specifies text to be output after the list of noun names.
<between>
The <between> element specifies text to be output between each of the noun names.
<beforeEach>
The <beforeEach> element specifies text to be output before each of the noun names.
<afterEach>
The <beforeEach> element specifies text to be output after each of the noun names.
<forEachNounCallFunction>
This element allows you to provide the name of a function, defined by a <definition> element outside of the element containing the <statementNounList> operator. statementNounList will call this function, providing the current noun in the list as the current noun for the called function.
For a detailed example of the use of <forEachNounCallFunction>, refer to the section: Key Concepts: XML Template.
<sortByFunction>
This element allows you to provide the name of a function, defined by a <definition> element outside of the element containing the <statementNounList> operator. statementNounList will call this function to determine the sort order of the nouns in the statementNounList list.
So, for example, let's say you want to display a list of people, but instead of alphabetical order, you want the people in order of birth date. You could use the <sortByFunction> operator to call a function that returned the person's birth date (using statementNoun). The list of people would then be sorted by birth date.
<sortByOrder>
This element allows you to specify ascending or descending order for the sorting of items in the list.
For example:
<sortByOrder>ascending</sortByOrder>
or
<sortByOrder>descending</sortByOrder>
<hideNounList>
This element allows you to hide the direct output of the statementNounList operator.
If you specify:
<hideNounList>True</hideNounList>
then the statementNounList operator will find a list of nouns, but it won't output the list.
The <hideNounList> operator is useful when used with the <forEachNounCallFunction> operator.
If you specify:
<hideNounList>True</hideNounList>
<forEachNounCallFunction>personSummary</forEachNounCallFunction>
then the statementNounList will find a list of people, then call personSummary for each of the people.
The personSummary function can then output a summary of each person.
If you didn't use <hideNounList>True</hideNounList>, then statementNounList would display the person's name before it called personSummary each time, which would cause the person's name to appear at the top of the person summary, which may not e what you want.
For a detailed example of the use of <hideNounList>, refer to the section: Key Concepts: XML Template.
Purpose: This operator outputs the text it is given.
Example
<value>
<operator>staticText</operator>
<before>Hello#nbsp#</before>
<after>world.</after>
<value>
Elements
<before>
The <before> element indicates the text to be output first.
<after>
The <after> element indicates text to be output second.
Purpose: This operator outputs the text it is given only if the <anchor>, <target> and <statementPattern> elements find a noun.
Example
<value>
<operator>staticTextIfNotBlank</operator>
<anchor>subject</anchor>
<target>object</after>
<statementPattern>person|?|is a member of|collection|Top Customers</statementPattern>
<before>Best Customer?#nbsp#</before>
<staticText>Yes</staticText>
<value>
This example would output an "Top Customer? Yes" only if the current noun was a member of the "Best Customers" collection.
Otherwise, the example would output ""Top Customer?"
Elements
<before>
The <before> element indicates the text to be output before the staticText (if any).
<after>
The <after> element indicates text to be output after the staticText (if any).
<anchor>
The <anchor> element indicates the place in the statement where the current noun is found.
Possible <anchor> elements are:
<anchor>subject</anchor>
<anchor>object</anchor>
<anchor>object of preposition</anchor>
You can only use one of these <anchor> elements in a statementNoun element.
<target>
The <target> element indicates the place in the statement where the noun to be returned is found.
Possible <target> elements are:
<target>subject</target>
<target>object</target>
<target>object of preposition</target>
You can only use one of these <target> elements in a statementNoun element.
The <anchor> and <target> elements work together.
A common combination is:
<anchor>subject</anchor>
<target>object</target>
which would mean that the current noun is the subject of the statement, and the target noun is the object.
<statementPattern>
The statementPattern indicates the statement type of the statement containing the target noun.
The parts of the statement pattern are separated by vertical bars ("|").
Purpose: This operator returns the number of specified statements that match the given criteria.
statementCount is similar to statementNounList, except that statementNounList returns a list of noun names, and statementCount returns a count of the nouns.
Example
<value>
<operator>statementCount</operator>
<anchor>subject</anchor>
<target>object</target>
<statementPattern>person|?|is a member of|collection|Top Customers</statementPattern>
<before>Number of top customers:#nbsp#</before>
<after>.</after>
</value>
Output: Number of top customers: 47.
Elements
<anchor>
The <anchor> element indicates the place in the statements where the current noun is found.
Possible <anchor> elements are:
<anchor>subject</anchor>
<anchor>object</anchor>
<anchor>object of preposition</anchor>
You can only use one of these <anchor> elements in a statementCount element.
<target>
The <target> element indicates the place in the statements where the nouns (or statements containing those nouns) to be counted are found.
Possible <target> elements are:
<target>subject</target>
<target>object</target>
<target>object of preposition</target>
You can only use one of these <target> elements in a statementCount element.
The <anchor> and <target> elements work together.
A common combination is:
<anchor>subject</anchor>
<target>object</target>
which would mean that the current noun is the subject of the statement, and the target noun is the object.
<statementPattern>
The statementPattern indicates the statement type of the statements being counted.
The parts of the statement pattern are separated by vertical bars ("|").
<before>
The <before> element specifies text to be output before the count.
<after>
The <after> element specifies text to be output after the count.
That's it!
As always, feel free to contact us with any questions.