DifferenceToXmlDoc (UserStatistics function): Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 6: | Line 6: | ||
DifferenceToXmlDoc is a member of the [[UserStatistics class]]. | DifferenceToXmlDoc is a member of the [[UserStatistics class]]. | ||
</p> | </p> | ||
This method returns to an XML document the difference in values between one | This method returns to an XML document the difference in values between one | ||
UserStatistics object and another for all Login statistics with non-zero values | UserStatistics object and another for all Login statistics with non-zero values | ||
(by default) or for all Login statistics (as an option). | (by default) or for all Login statistics (as an option). | ||
See the description of [[UserStatistics class#login|login statistics]]. | See the description of [[UserStatistics class#login|login statistics]]. | ||
===Syntax=== | ===Syntax=== | ||
Line 39: | Line 39: | ||
statistic values are to be displayed as text or as value attributes within | statistic values are to be displayed as text or as value attributes within | ||
their XML document elements. | their XML document elements. | ||
For example, <tt><DKRD>1107</DKRD></tt> is text format, | For example, <tt><DKRD>1107</DKRD></tt> is text format, | ||
and <tt><DKRD value="1107"/></tt> is attribute-value format. | and <tt><DKRD value="1107"/></tt> is attribute-value format. | ||
The default value is <tt>False</tt>, which produces text format. | The default value is <tt>False</tt>, which produces text format. | ||
<dt><b>AttributeNames= </b><i>bool</i> | <dt><b>AttributeNames= </b><i>bool</i> | ||
Line 49: | Line 49: | ||
within their XML document elements | within their XML document elements | ||
as the element name or as the value of a “name” attribute. | as the element name or as the value of a “name” attribute. | ||
For example, <tt><DKRD>1107</DKRD></tt> is element-name format, | For example, <tt><DKRD>1107</DKRD></tt> is element-name format, | ||
and the following is name-as-attribute format: | and the following is name-as-attribute format: | ||
< | <p class="code"><nowiki><stat name="DKRD"> | ||
1107 | |||
</stat> | |||
</nowiki></p> | |||
</ | |||
The default value is <tt>False</tt>, which produces element-name format. | The default value is <tt>False</tt>, which produces element-name format. | ||
<dt><b>NamesToLower= </b><i>bool</i> | <dt><b>NamesToLower= </b><i>bool</i> | ||
Line 65: | Line 64: | ||
The default value is <tt>False</tt>. | The default value is <tt>False</tt>. | ||
<dt><b>AttributeNames= </b><i>bool</i> | <dt><b>AttributeNames= </b><i>bool</i> | ||
</dl> | </dl> | ||
===Usage Notes=== | ===Usage Notes=== | ||
Line 74: | Line 73: | ||
the value differences for all, or all non-zero, Login statistics. | the value differences for all, or all non-zero, Login statistics. | ||
</ul> | </ul> | ||
===Examples=== | ===Examples=== | ||
The display of non-zero difference statistics below is produced | The display of non-zero difference statistics below is produced | ||
by a sequence of statements like the following: | by a sequence of statements like the following: | ||
< | <p class="code"><nowiki>%doc is object xmldoc | ||
%statStart is object userstatistics | |||
%statEnd is object userstatistics | |||
. . . | |||
%doc = %statEnd:differencetoXmlDoc(%statStart, zeros=false) | |||
%doc:Print | |||
</nowiki></p> | |||
</ | |||
The following are sample results: | The following are sample results: | ||
< | <p class="code"><nowiki><UserStatisticsDifferences time="20080903121750819" | ||
userNumber="20" loginTime="20080903115821710" | |||
baseTime="20080903121750818"> | |||
<SQWR>2</SQWR> | |||
<MOVE>2</MOVE> | |||
<DKAR>2</DKAR> | |||
</UserStatisticsDifferences> | |||
</nowiki></p> | |||
</ | |||
A <code>%doc = %statEnd:differencetoXmlDoc(%statStart)</code> | |||
A < | |||
statement would | statement would | ||
return all the statistics, including those with a < | return all the statistics, including those with a <code>0</code> value. |
Revision as of 16:52, 28 February 2011
XmlDoc with difference of all Login statistic value
DifferenceToXmlDoc is a member of the UserStatistics class.
This method returns to an XML document the difference in values between one UserStatistics object and another for all Login statistics with non-zero values (by default) or for all Login statistics (as an option).
See the description of login statistics.
Syntax
%doc = %ustat:DifferenceToXmlDoc( %ustatOld - [, Zeros=bool] - [, AttributeValues=bool] - [, AttributeNames=bool] - [, NamestoLower=bool] )
Syntax terms
- %doc
- A Janus SOAP XmlDoc object variable to contain the listing of the difference values of the Login statistics.
- %ustat
- A UserStatistics object variable.
- %ustatOld
- An older UserStatistics object variable for the same user login as %ustat.
- Zeros= bool
- This name required argument (Zeros) is a boolean value that indicates whether differences with a zero value should be included in the returned data. Zeros is an optional argument that defaults to False, which results in non-zero values only being included.
- AttributeValues= bool
- This name required argument (AttributeValues) is a boolean value that indicates whether statistic values are to be displayed as text or as value attributes within their XML document elements. For example, <DKRD>1107</DKRD> is text format, and <DKRD value="1107"/> is attribute-value format. The default value is False, which produces text format.
- AttributeNames= bool
- This name required argument (AttributeNames) is a boolean value
that indicates whether statistic names are to be displayed
within their XML document elements
as the element name or as the value of a “name” attribute.
For example, <DKRD>1107</DKRD> is element-name format,
and the following is name-as-attribute format:
<stat name="DKRD"> 1107 </stat>
The default value is False, which produces element-name format.
- NamesToLower= bool
- This name required argument (NamesToLower) is a boolean value that indicates whether statistic names are to be displayed in lowercase characters. The default value is False.
- AttributeNames= bool
Usage Notes
- The Difference function returns the value differences between two UserStatistics objects for the Login statistic you specify. The DifferenceToString function returns to a longstring the value differences for all, or all non-zero, Login statistics.
Examples
The display of non-zero difference statistics below is produced by a sequence of statements like the following:
%doc is object xmldoc %statStart is object userstatistics %statEnd is object userstatistics . . . %doc = %statEnd:differencetoXmlDoc(%statStart, zeros=false) %doc:Print
The following are sample results:
<UserStatisticsDifferences time="20080903121750819" userNumber="20" loginTime="20080903115821710" baseTime="20080903121750818"> <SQWR>2</SQWR> <MOVE>2</MOVE> <DKAR>2</DKAR> </UserStatisticsDifferences>
A %doc = %statEnd:differencetoXmlDoc(%statStart)
statement would
return all the statistics, including those with a 0
value.