Ken Webb 2010-02-23T18:37:18Z
XQuery is a powerful standard language for querying XML content. It plays the same function for XML, that SQL plays for relational databases.
With the Xholon GUI, an XQuery Console window can be opened on any node in the Xholon application. XQuery expressions are entered into the console and XQuery results are returned. Xholon uses Saxon as its XQuery engine, but several other products have also been successfully tested.
The XQuery service is only instantiated when a user invokes the XQuery console. It is not integrated inside Xholon, so normally it doesn't consume any extra resources. Xholon writes out the selected subtree as an XML string, and passes the string to the XQuery service for processing.
The XQuery console also offers very preliminary support for the XQuery Update Facility (XUF).
Note that the XQuery console GUI is specified using the Xholon Swing declarative XML, most of which is included below.
<?xml version="1.0" encoding="UTF-8"?> <!-- XQuery GUI - Composite Structure Hierarchy Xholon 0.8 http://www.primordion.com/Xholon --> <JFrame xmlns:swat="http://www.primordion.com/namespace/SwingAttribute"> <swat:Attribute_String roleName="Title">XQuery</swat:Attribute_String> <swat:Attribute_int roleName="DefaultCloseOperation">2</swat:Attribute_int> <!-- 2 3 --> <JMenuBar> <JMenu> <swat:Attribute_String roleName="Text">File</swat:Attribute_String> <JMenuItem> <swat:Attribute_String roleName="Text">Open</swat:Attribute_String> <swat:Attribute_String roleName="ActionCommand">fileopen</swat:Attribute_String> </JMenuItem> ... </JMenu> </JMenuBar> <JSplitPane> <swat:Attribute_int roleName="Orientation">0</swat:Attribute_int> <JScrollPane roleName="top"> <JPanel> <VBoxLayout/> <JLabel> <swat:Attribute_String roleName="Text">Query</swat:Attribute_String> </JLabel> <JScrollPane> <JTextPane roleName="queryPane"> <swat:Attribute_String roleName="Text">return $x</swat:Attribute_String> <swat:Attribute_String roleName="PreferredSize">Dimension,200,100</swat:Attribute_String> </JTextPane> </JScrollPane> </JPanel> </JScrollPane> <JScrollPane roleName="bottom"> <JPanel> <VBoxLayout/> <JLabel> <swat:Attribute_String roleName="Text">Result</swat:Attribute_String> </JLabel> <JScrollPane> <JTextPane roleName="resultPane"> <swat:Attribute_String roleName="Text"></swat:Attribute_String> <swat:Attribute_String roleName="PreferredSize">Dimension,200,100</swat:Attribute_String> </JTextPane> </JScrollPane> <JButton> <swat:Attribute_String roleName="Text">Submit Query</swat:Attribute_String> <swat:Attribute_String roleName="ActionCommand">submitquery</swat:Attribute_String> </JButton> </JPanel> </JScrollPane> </JSplitPane> </JFrame>
Because the XQuery GUI is created as just another Xholon subtree, a separate XQuery window can be opened up on the nodes of the first XQuery window. Everything in a Xholon application is just another node in a tree, and they can all be accessed in the same way. This second XQuery window is shown below.