ToXmlDoc (UserStatistics function): Difference between revisions
m (1 revision) |
m (match syntax table to syntax template, tags and edits) |
||
Line 1: | Line 1: | ||
{{Template:UserStatistics:ToXmlDoc subtitle}} | {{Template:UserStatistics:ToXmlDoc subtitle}} | ||
<var>ToXmlDoc</var> returns in a <var class="product">[[Janus SOAP]]</var> <var>[[XmlDoc_class|XmlDoc]]</var> object the values of the statistics in the method <var>UserStatistics</var> object. By default, it will only return those statistics with non-zero values; but, optionally, may return all (including zero) statistics. | |||
in the method UserStatistics object. | |||
all | |||
==Syntax== | ==Syntax== | ||
{{Template:UserStatistics:ToXmlDoc syntax}} | {{Template:UserStatistics:ToXmlDoc syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th | <tr><th>%doc</th> | ||
<td>An XmlDoc object variable to contain the listing of the values of the statistics. </td></tr> | <td>An XmlDoc object variable to contain the listing of the values of the statistics. </td></tr> | ||
<tr><th> | <tr><th>userStatistics</th> | ||
<td>A UserStatistics object variable. </td></tr> | <td>A <var>UserStatistics</var> object variable. </td></tr> | ||
<tr><th | <tr><th>Zeros</th> | ||
<td>This <var>[[Methods#Named parameters|Name-Required]]</var> argument (<var class="term">Zeros</var>) is a <var>[[Boolean]]</var> value that indicates whether statistics with a zero value should be included in the returned data. <var class="term">Zeros</var> is an optional argument that defaults to <var>False</var>, which results in the inclusion of only statistics with non-zero values. </td></tr> | |||
<tr><th | <tr><th>AttributeValues</th> | ||
<td>This <var>Name-Required</var> argument (<var class="term">AttributeValues</var>) is a <var>Boolean</var> value that indicates whether statistic values are to be displayed as text or as value attributes within their XML document elements. For example: | |||
<tr><th | <p class="output"><DKRD>1107</DKRD></p> is text format, and <p class="output"><DKRD value="1107"/></p> is attribute value format. The default value is <var>False</var>, which produces text format.</td></tr> | ||
<tr><th>AttributeNames</th> | |||
<tr><th | <td>This <var>Name-Required</var> argument (<var class="term">AttributeNames</var>) is a <var>Boolean</var> 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: | ||
<p class="output"><DKRD>1107</DKRD></p> is element-name format, and the following is name-as-attribute format: <p class="output"><stat name="DKRD"> 1107 </stat></p>The default value is <var>False</var>, which produces element-name format. </td></tr> | |||
<tr><th>NamesToLower</th> | |||
<td>This <var>Name-Required</var> argument (<var class="term">NamesToLower</var>) is a <var>Boolean</var> value that indicates whether statistic names are to be displayed in lowercase characters. The default value is <var>False</var>.</td></tr> | |||
</table> | </table> | ||
==Examples== | ==Examples== | ||
<ol><li>The following display of non-zero <var>[[UserStatistics_class#login|Login]]</var> and <var>[[UserStatistics_class#request|Request]]</var> statistics is produced by a sequence of statements like the following: | |||
The display of non-zero Login and Request statistics | |||
by a sequence of statements like the following: | |||
<p class="code">%doc is object xmldoc | <p class="code">%doc is object xmldoc | ||
%ustat is object userstatistics | %ustat is object userstatistics | ||
. . . | . . . | ||
%doc = %ustat:ToXmlDoc | %doc = %ustat:ToXmlDoc | ||
%doc: | %doc:print | ||
</p> | </p> | ||
The following are sample results: | The following are sample results: | ||
<p class=" | <p class="output"><UserStatistics id="40" time=20080902203110278 | ||
userNumber="6" loginTime="20080902094309010"> | userNumber="6" loginTime="20080902094309010"> | ||
<login> | <login> | ||
Line 71: | Line 63: | ||
</request> | </request> | ||
</UserStatistics> | </UserStatistics> | ||
</ | </p> | ||
<li>Using<p class="code">%doc = %ustat:ToXmlDoc(Zeros=true)</p> statement would return all the statistics, including those with a <code>0</code> value.</oL> | |||
return all the statistics, including those with a <code>0</code> value. | |||
==See also== | ==See also== | ||
<ul> | |||
<li><var>[[DifferenceToXmlDoc (UserStatistics function)|DifferenceToXmlDoc]]</var> returns, to an <var>XmlDoc</var> object, the difference in values between the <var>Login</var> statistics in one <var>UserStatistics</var> object and another. | |||
</ul> | |||
{{Template:UserStatistics:ToXmlDoc footer}} | {{Template:UserStatistics:ToXmlDoc footer}} |
Revision as of 03:24, 1 April 2011
Export the UserStatistics values to Xml (UserStatistics class)
ToXmlDoc returns in a Janus SOAP XmlDoc object the values of the statistics in the method UserStatistics object. By default, it will only return those statistics with non-zero values; but, optionally, may return all (including zero) statistics.
Syntax
%doc = userStatistics:ToXmlDoc[( [Zeros= boolean], - [AttributeValues= boolean], - [AttributeNames= boolean], - [NamesToLower= boolean])]
Syntax terms
%doc | An XmlDoc object variable to contain the listing of the values of the statistics. |
---|---|
userStatistics | A UserStatistics object variable. |
Zeros | This Name-Required argument (Zeros) is a Boolean value that indicates whether statistics with a zero value should be included in the returned data. Zeros is an optional argument that defaults to False, which results in the inclusion of only statistics with non-zero values. |
AttributeValues | 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 | 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 | 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. |
Examples
- The following display of non-zero Login and Request statistics is produced by a sequence of statements like the following:
%doc is object xmldoc %ustat is object userstatistics . . . %doc = %ustat:ToXmlDoc %doc:print
The following are sample results:
<UserStatistics id="40" time=20080902203110278 userNumber="6" loginTime="20080902094309010"> <login> <CNCT>38881</CNCT> <DKRD>7</DKRD> <DKWR>102</DKWR> <SQRD>79</SQRD> <SQWR>353</SQWR> <SGMTI>598</SGMTI> <SVRD>2</SVRD> <SVWR>2</SVWR> <CPU>27</CPU> <REQ>13</REQ> <MOVE>284</MOVE> <AUDIT>136</AUDIT> <WAIT>286</WAIT> <DKAR>173</DKAR> <DKPR>421</DKPR> <SMPLS>1595</SMPLS> <BLKI>1000</BLKI> <SCREENS>54</SCREENS> <SVPAGES>172</SVPAGES> </login> <request> <NTBL>8</NTBL> <QTBL>32</QTBL> <STBL>3776</STBL> <VTBL>177</VTBL> <PDL>168</PDL> </request> </UserStatistics>
- Using
%doc = %ustat:ToXmlDoc(Zeros=true)
statement would return all the statistics, including those with a0
value.
See also
- DifferenceToXmlDoc returns, to an XmlDoc object, the difference in values between the Login statistics in one UserStatistics object and another.