Configuring the Java Virtual Manager

For Windows

To set Java heap size options with Sun Java (JAVA_OPTS environment variable) on Windows

1.On the taskabar, click Start, and then point to Settings, Control Panel, and System.
2.In the System Properties dialog box Advanced tab, click Environment Variables.
3.In the Environment Variables dialog box, under System variables, click New.
4.In the New System Variable dialog box, enter:
1.Variable name: JAVA_OPTS.
2.Variable value -Xms256m -Xmx512m
5.Click OK.
6.Verify that the Environment Variables dialog box displays the following system variable name value pair:

JAVA_OPTS="-Xms256m -Xmx512m "
7.Click OK, OK to close the System Properties dialog box.

For Unix/Linux

To set Java heap size options with Sun Java (JAVA_OPTS environment variable) on Unix/Linux

1.Start a terminal session.
2.At the command prompt type:

export set JAVA_OPTS=”-Xms256m -Xmx512m”
3.Close the terminal session.

Java Edition Installation

For the installed Java Edition, a UBmatrix Processing Engine - Java Edition.lax file is automatically generated in the root folder (C:/Program Files/UBmatrix/UBmatrix_Processing_Engine_Java_Edition/UBmatrix Processing Engine - Java Edition.lax).

The heap size appears at lines 67-71:

# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX

# -------------------------------------

# maximum heap size to 512m

lax.nl.java.option.java.heap.size.max=786432000

The above configuration sets maximum heap size to approximately 786 KB.
Command Line Settings

The maximum heap size can be set as a parameter in the XbrlCalculate.cmd:

set JAVA_OPTS=-Xms768m -Xmx1g -XX:PermSize=128m -XX:MaxPermSize=256m

java %JAVA_OPTS% -cp "%CLASSPATH%" ubmatrix.xbrl.tools.xbrlCalculate.src.XbrlCalculate %*

or in the XbrlCalculate.sh:

JAVA_OPTS="-Xms768m -Xmx1g -XX:PermSize=128m -XX:MaxPermSize=256m"

java ${JAVA_OPTS} -cp "${CLASSPATH}" ubmatrix.xbrl.tools.xbrlCalculate.src.XbrlCalculate $@

JAVA_OPTS is an ENV variable that has local scope to the script file. The maximum heap size in the above configuration is set to 1g (1 gigabyte).

The shell configuration adjustments apply to all script files shipped with XPE 3.5.

Basic XQuery concepts

W3C XQuery is a query language for XML.The most common use cases for XQuery involve XML publishingto create XML for Web messages, dynamic web sites, or publishing applications.

Most XQuery functionality, such as arithmetic operators, comparisons, function calls, and functions, is familiar to most programmers.The original data may be found in XML files, or it may be in a data store such as a relational.

XQuery are made up of three components:

1) Finding XML Nodes: Path Expressions


Just as SQL needs to be able to access any row or column in a relational table,
XQuery needs to be able to access any node in an XML document. XML structures have both hierarchy and sequence, and can contain complex structure.

2)Creating XML: XML Constructors
Now that we have seen how to locate anything in an XML document or a relational table,let's learn how to create new XML structures using XML constructors.

3) Restructuring Data: FLWOR Expressions
XQuery has an expression called a FLWOR expression,
which is similar to a SQL Select statement that that has From and Where clauses.
FLWOR is pronounced "flower", and is an acronym for the keywords used to introduce each clause
(for, let, where, order by, and return).

Sample Example :-
define function reverse($items){
let $count := count($items)
for $i in 0 to $count
return $items[$count - $i]

}