Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > b3bdfe6d859a3d6920ff2c44b38e9a6f > files > 1523

saxon-manual-9.4.0.9-2.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 09 20:48:46 GMT 2011 -->
<TITLE>
XQSequence
</TITLE>

<META NAME="date" CONTENT="2011-12-09">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="XQSequence";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/xml/xquery/XQResultSequence.html" title="interface in javax.xml.xquery"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/xml/xquery/XQSequenceType.html" title="interface in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?javax/xml/xquery/XQSequence.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="XQSequence.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.xml.xquery</FONT>
<BR>
Interface XQSequence</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../../javax/xml/xquery/XQItemAccessor.html" title="interface in javax.xml.xquery">XQItemAccessor</A></DD>
</DL>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../javax/xml/xquery/XQResultSequence.html" title="interface in javax.xml.xquery">XQResultSequence</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../net/sf/saxon/xqj/SaxonXQForwardSequence.html" title="class in net.sf.saxon.xqj">SaxonXQForwardSequence</A>, <A HREF="../../../net/sf/saxon/xqj/SaxonXQSequence.html" title="class in net.sf.saxon.xqj">SaxonXQSequence</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>XQSequence</B><DT>extends <A HREF="../../../javax/xml/xquery/XQItemAccessor.html" title="interface in javax.xml.xquery">XQItemAccessor</A></DL>
</PRE>

<P>
This interface represents a sequence of items as defined in the 
 XDM. The sequence may be materialized or non-materialized. <p>
 
 The <code>next</code> method is useful to position the 
 <code>XQSequence</code> over the next item in the sequence. 
 If the scrollability is <code>XQConstants.SCROLLTYPE_SCROLLABLE</code>,
 then the <code>previous</code> method can be called to move backwards. 
 
 In the case of a forward only sequence, the get methods may be only called
 once per item. To perform multiple gets on an item, extract the item first
 from the sequence using the <code>getItem</code> method and 
 then operate on the <code>XQItem</code> object. 
  
 <pre>
 
  XQPreparedExpression expr = conn.prepareExpression("for $i ..");
  XQSequence result = expr.executeQuery();
 
  // create the ItemTypes for string and integer
  XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
  XQItemType intType = conn.createAtomicType(XQItemType.XQBASETYPE_INT);

  // positioned before the first item
  while (result.next())
  {
    XQItemType type = result.getItemType();
 
    // If string, then get the string value out
    if (type.equals(strType))
      String str = result.getAtomicValue();
    else if (type.equals(intType))  // if it is an integer..
      int intval = result.getInt();
 
     ...
  }
 
 </pre>

 In a sequence, the cursor may be positioned on an item, after the last item
 or before the first item. The <code>getPosition</code> method 
 returns the current position number. A value of 0 indicates
 that it is  positioned before the first item, a value of <code>count() + 1</code>
 indicates that it is positioned after the last item, and any other value
 indicates that it is positioned on the item at that position.  <p>
 For example, a position value of 1 indicates that it is positioned on 
 the item at position 1. <p>

 The <code>isOnItem</code> method may be used to find out if the cursor
 is positioned on the item. When the cursor is positioned on an item,
 the <code>next</code> method call will move the cursor to be on the next item.
 <p>
 
 See also: <i>Section 12 Serialization, XQuery API for Java
 (XQJ) 1.0</i>,  which describes some general information applicable
 to various XQJ serialization methods.
<P>

<P>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#absolute(int)">absolute</A></B>(int&nbsp;itempos)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the <code>XQSequence</code>'s position to the given item
 number in this object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#afterLast()">afterLast</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Move to the position after the last item.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#beforeFirst()">beforeFirst</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves to the position before the first item.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#close()">close</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes the sequence and frees all resources associated with this 
 sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#count()">count</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a number indicating the number of items in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#first()">first</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves to the first item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/xml/xquery/XQItem.html" title="interface in javax.xml.xquery">XQItem</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#getItem()">getItem</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the current item as an immutable <code>XQItem</code> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#getPosition()">getPosition</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gets the current cursor position.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html?is-external=true" title="class or interface in javax.xml.stream">XMLStreamReader</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#getSequenceAsStream()">getSequenceAsStream</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Read the entire sequence starting from the current position as an
 <code>XMLStreamReader</code> object, as described in 
 <i>Section 12.1 Serializing an XDM instance into a StAX event stream
 (XMLStreamReader), XQuery API for Java (XQJ) 1.0</i>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#getSequenceAsString(java.util.Properties)">getSequenceAsString</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;props)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serializes the sequence starting from the current position to a String
 according to the <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#isAfterLast()">isAfterLast</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the current position is after the last item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#isBeforeFirst()">isBeforeFirst</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the current position before the first item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#isClosed()">isClosed</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the sequence is closed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#isFirst()">isFirst</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the current position at the first item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#isLast()">isLast</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the current position at the last item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#isOnItem()">isOnItem</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if the sequence is positioned on an item or not.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#isScrollable()">isScrollable</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the sequence is scrollable.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#last()">last</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves to the last item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#next()">next</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves to the next item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#previous()">previous</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves to the previous item in the sequence.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#relative(int)">relative</A></B>(int&nbsp;itempos)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Moves the cursor a relative number of items, either positive or negative.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#writeSequence(java.io.OutputStream, java.util.Properties)">writeSequence</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A>&nbsp;os,
              <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;props)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serializes the sequence starting from the current position to an
 <code>OutputStream</code> according to the 
 <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#writeSequence(java.io.Writer, java.util.Properties)">writeSequence</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A>&nbsp;ow,
              <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;props)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Serializes the sequence starting from the current position to a Writer
 according to the  <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#writeSequenceToResult(javax.xml.transform.Result)">writeSequenceToResult</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Result.html?is-external=true" title="class or interface in javax.xml.transform">Result</A>&nbsp;result)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the entire sequence starting from the current position to a
 <code>Result</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/xml/xquery/XQSequence.html#writeSequenceToSAX(org.xml.sax.ContentHandler)">writeSequenceToSAX</A></B>(<A HREF="http://download.oracle.com/javase/6/docs/api/org/xml/sax/ContentHandler.html?is-external=true" title="class or interface in org.xml.sax">ContentHandler</A>&nbsp;saxhdlr)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the entire sequence starting from the current position to a SAX
 handler, as described in <i>Section 12.2 Serializing an XDM instance
 into a SAX event stream, XQuery API for Java (XQJ) 1.0</i>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.xml.xquery.XQItemAccessor"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from interface javax.xml.xquery.<A HREF="../../../javax/xml/xquery/XQItemAccessor.html" title="interface in javax.xml.xquery">XQItemAccessor</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getAtomicValue()">getAtomicValue</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getBoolean()">getBoolean</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getByte()">getByte</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getDouble()">getDouble</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getFloat()">getFloat</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getInt()">getInt</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getItemAsStream()">getItemAsStream</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getItemAsString(java.util.Properties)">getItemAsString</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getItemType()">getItemType</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getLong()">getLong</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getNode()">getNode</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getNodeUri()">getNodeUri</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getObject()">getObject</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#getShort()">getShort</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#instanceOf(javax.xml.xquery.XQItemType)">instanceOf</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItem(java.io.OutputStream, java.util.Properties)">writeItem</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItem(java.io.Writer, java.util.Properties)">writeItem</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItemToResult(javax.xml.transform.Result)">writeItemToResult</A>, <A HREF="../../../javax/xml/xquery/XQItemAccessor.html#writeItemToSAX(org.xml.sax.ContentHandler)">writeItemToSAX</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="absolute(int)"><!-- --></A><H3>
absolute</H3>
<PRE>
boolean <B>absolute</B>(int&nbsp;itempos)
                 throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Moves the <code>XQSequence</code>'s position to the given item
 number in this object. If the item number is positive, the
 <code>XQSequence</code> moves to the given item number with
 respect to the beginning of the <code>XQSequence</code>.  <p>
 The first item is item 1, the second is item 2, and so on. <p>
 If the given item number is negative, the <code>XQSequence</code>
 positions itself on an absolute item position with respect to the
 end of the sequence. 
 <p>
 For example, calling the method <code>absolute(-1)</code>
 positions the <code>XQSequence</code> on the last item; 
 calling the method <code>absolute(-2)</code> moves the
 <code>XQSequence</code> to the next-to-last item, and so on. 
 <code>absolute(0)</code> will position the sequence before the first item.
 <p>
 An attempt to position the sequence beyond the first/last item 
 set leaves the current position to be before the first item or 
 after the last item. <p>

 Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>itempos</CODE> - the item position to jump to
<DT><B>Returns:</B><DD><code>true</code> if the current position is
                            within the sequence, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only, or
                            (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="afterLast()"><!-- --></A><H3>
afterLast</H3>
<PRE>
void <B>afterLast</B>()
               throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Move to the position after the last item.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only,
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="beforeFirst()"><!-- --></A><H3>
beforeFirst</H3>
<PRE>
void <B>beforeFirst</B>()
                 throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Moves to the position before the first item.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only,
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="close()"><!-- --></A><H3>
close</H3>
<PRE>
void <B>close</B>()
           throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Closes the sequence and frees all resources associated with this 
 sequence. 

 Closing an <code>XQSequence</code> object also implicitly closes all
 <code>XQItem</code> objects obtained from it.
 
 All methods other than the <code>isClosed</code> 
 or <code>close</code> method will raise exceptions when invoked 
 after closing the sequence. 
 Calling <code>close</code> on an <code>XQSequence</code> object
 that is already closed has no effect.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if there are errors during closing of
                            the sequence</DL>
</DD>
</DL>
<HR>

<A NAME="isClosed()"><!-- --></A><H3>
isClosed</H3>
<PRE>
boolean <B>isClosed</B>()</PRE>
<DL>
<DD>Checks if the sequence is closed.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the sequence is in
                             a closed state, <code>false</code> otherwise</DL>
</DD>
</DL>
<HR>

<A NAME="count()"><!-- --></A><H3>
count</H3>
<PRE>
int <B>count</B>()
          throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Returns a number indicating the number of items in the sequence.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>the number of items in this sequence
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward-only, or (2)
                            the sequence is closed</DL>
</DD>
</DL>
<HR>

<A NAME="getPosition()"><!-- --></A><H3>
getPosition</H3>
<PRE>
int <B>getPosition</B>()
                throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Gets the current cursor position. <p>
 0 indicates that the position is before the first item 
 and <code>count() + 1</code> indicates position after the last item.
 A specific position indicates that the cursor is positioned on
 the item at that position. Use the <code>isOnItem</code>
 method to verify if the cursor is positioned on the item.<p>

 Calling this method on an empty sequence 
 will return <code>0</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward-only, or (2)
                            the sequence is closed</DL>
</DD>
</DL>
<HR>

<A NAME="isOnItem()"><!-- --></A><H3>
isOnItem</H3>
<PRE>
boolean <B>isOnItem</B>()
                 throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Check if the sequence is positioned on an item or not. 
 Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the sequence is currently
                            positioned on an item, <code>false</code> if sequence 
                            is positioned before the first item, or after the last
                            item
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="isScrollable()"><!-- --></A><H3>
isScrollable</H3>
<PRE>
boolean <B>isScrollable</B>()
                     throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Checks if the sequence is scrollable.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the sequence can be scrolled
                            backward or forward, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="first()"><!-- --></A><H3>
first</H3>
<PRE>
boolean <B>first</B>()
              throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Moves to the first item in the sequence. The method returns 
 <code>true</code>, if it was able to move to the first item in the sequence
 <code>false</code>, otherwise. Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the sequence was positioned 
                            on the first item, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only,
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="getItem()"><!-- --></A><H3>
getItem</H3>
<PRE>
<A HREF="../../../javax/xml/xquery/XQItem.html" title="interface in javax.xml.xquery">XQItem</A> <B>getItem</B>()
               throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Get the current item as an immutable <code>XQItem</code> object. 
 In case of an <code>XQResultSequence</code>, the item is an
 <code>XQResultItem</code>.
 In the case of forward only sequences, this method or any other 
 get or write method may only be called once on the curent item. <p>

 The <code>XQItem</code> object is dependent on the sequence from which
 it was created and is only valid for the duration of <code>XQSequence</code>
 lifetime. Thus, the <code>XQSequence</code> is closed, this <code>XQItem</code>
 object will be implicitly closed and it can no longer be used.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>an <code>XQItem</code> object
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) there are errors retrieving the item,
                            or (2) in the case of a forward only sequence,
                            a get or write method has already been invoked
                            on the current item.</DL>
</DD>
</DL>
<HR>

<A NAME="getSequenceAsStream()"><!-- --></A><H3>
getSequenceAsStream</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/stream/XMLStreamReader.html?is-external=true" title="class or interface in javax.xml.stream">XMLStreamReader</A> <B>getSequenceAsStream</B>()
                                    throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Read the entire sequence starting from the current position as an
 <code>XMLStreamReader</code> object, as described in 
 <i>Section 12.1 Serializing an XDM instance into a StAX event stream
 (XMLStreamReader), XQuery API for Java (XQJ) 1.0</i>.

 Note that the serialization process might fail, in which case a 
 <code>XQException</code> is thrown.
 
 While the stream is being read, the application MUST NOT do any other
 concurrent operations on the sequence. The operation on the stream is
 undefined if the underlying sequence position or state is changed by
 concurrent operations.
 
 After all items are written to the stream, the current position of the
 cursor is set to point after the last item.
 
 Also, in the case of forward only sequences, this method may only be
 called if the current item has not yet been read through any of the get
 or write methods.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD>an XML reader object as <code>XMLStreamReader</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) there are errors accessing any of the items
                            in the sequence, (2) the sequence is in a closed state,
                            (3) in the case of a forward only sequence, a get or write
                            method has already been invoked on the current item, or 
                            (4) in case of an error during serialization of the sequence
                            into a StAX event stream as defined in <i>Section 12.1 
                            Serializing an XDM instance into a StAX event stream
                            (XMLStreamReader), XQuery API for Java (XQJ) 1.0</i></DL>
</DD>
</DL>
<HR>

<A NAME="getSequenceAsString(java.util.Properties)"><!-- --></A><H3>
getSequenceAsString</H3>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getSequenceAsString</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;props)
                           throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Serializes the sequence starting from the current position to a String
 according to the <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>.

 Serialization parameters, which influence how serialization is
 performed, can be specified. Refer to the 
 <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>
 and <i>Section 12 Serialization, XQuery
  API for Java (XQJ) 1.0</i> for more information.
 
 Reading the sequence during the serialization process performs implicit
 next operations to read the items. 

 After all items are written to the stream, the current position of the
 cursor is set to point after the last item.

 Also, in the case of forward only sequences, this method may only be
 called if the current item has not yet been read through any of the get
 or write methods.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>props</CODE> - specifies the serialization parameters,
                            <code>null</code> is considered equivalent to an
                            empty <code>Properties</code> object
<DT><B>Returns:</B><DD>the serialized representation of the sequence
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) there are errors accessing the items in 
                            the sequence, (2) there are errors
                            during serialization, (3) the sequence is in a closed state,
                            or (4) in the case of a forward only sequence, a get or
                            write method has already been invoked on the current item</DL>
</DD>
</DL>
<HR>

<A NAME="isAfterLast()"><!-- --></A><H3>
isAfterLast</H3>
<PRE>
boolean <B>isAfterLast</B>()
                    throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Checks if the current position is after the last item in the sequence.
 Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the current position is
                            after the last item, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only, 
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="isBeforeFirst()"><!-- --></A><H3>
isBeforeFirst</H3>
<PRE>
boolean <B>isBeforeFirst</B>()
                      throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Checks if the current position before the first item in the sequence.
 Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the current position is
                            before the first item, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only, 
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="isFirst()"><!-- --></A><H3>
isFirst</H3>
<PRE>
boolean <B>isFirst</B>()
                throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Checks if the current position at the first item in the sequence.
 Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the current position is at
                            the first item, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only, 
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="isLast()"><!-- --></A><H3>
isLast</H3>
<PRE>
boolean <B>isLast</B>()
               throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Checks if the current position at the last item in the sequence.
 Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the current position is at
                            the last item, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only,
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="last()"><!-- --></A><H3>
last</H3>
<PRE>
boolean <B>last</B>()
             throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Moves to the last item in the sequence. This method returns
 <code>true</code>, if it was able to move to the last item in the sequence
 <code>false</code>, otherwise. Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the sequence was positioned
                            on the last item, <code>false</code> otherwise
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only,
                            or (2) the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="next()"><!-- --></A><H3>
next</H3>
<PRE>
boolean <B>next</B>()
             throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Moves to the next item in the sequence.  Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the new item is valid,
                            <code>false</code> if there are no more items
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if the sequence is in a closed state</DL>
</DD>
</DL>
<HR>

<A NAME="previous()"><!-- --></A><H3>
previous</H3>
<PRE>
boolean <B>previous</B>()
                 throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Moves to the previous item in the sequence.  Calling this method on an empty sequence 
 will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the new current position is
                            within the sequence, (i.e., not before first);
                            <code>false</code> otherwise.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only, or
                            (2) the sequence is in a closed state.</DL>
</DD>
</DL>
<HR>

<A NAME="relative(int)"><!-- --></A><H3>
relative</H3>
<PRE>
boolean <B>relative</B>(int&nbsp;itempos)
                 throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Moves the cursor a relative number of items, either positive or negative. 
 Attempting to move beyond the first/last item in the sequence positions 
 the sequence before/after the the first/last item.  
 Calling <code>relative(0)</code> is valid, but does not change the cursor position.  
 <p>
 Note: Calling the method <code>relative(1)</code> is identical to calling the method 
 <code>next</code> and calling the method <code>relative(-1)</code> is identical
 to calling the method <code>previous()</code>. 
 Calling this method on an empty sequence will return <code>false</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>itempos</CODE> - the item position to jump to
<DT><B>Returns:</B><DD><code>true</code> if the new current position is within
                            the sequence (i.e., not before first or after last);
                            <code>false</code> otherwise.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) the sequence is forward only, or
                            (2) the sequence is in a closed state.</DL>
</DD>
</DL>
<HR>

<A NAME="writeSequence(java.io.OutputStream, java.util.Properties)"><!-- --></A><H3>
writeSequence</H3>
<PRE>
void <B>writeSequence</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A>&nbsp;os,
                   <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;props)
                   throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Serializes the sequence starting from the current position to an
 <code>OutputStream</code> according to the 
 <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>.

 Serialization parameters, which influence how serialization is
 performed, can be specified. Refer to the
 <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>
 and <i>Section 12 Serialization, XQuery
 API for Java (XQJ) 1.0</i> for more information.
 
 Reading the sequence during the serialization process performs implicit
 next operations to read the items. 

 After all items are written to the stream, the current position of the
 cursor is set to point after the last item.

 Also, in the case of forward only sequences, this method may only be
 called if the current item has not yet been read through any of the
 get or write methods.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>os</CODE> - the output stream into which the sequence is to be serialized<DD><CODE>props</CODE> - specifies the serialization parameters,
                            <code>null</code> is considered equivalent to an empty
                            <code>Properties</code> object
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) there are errors accessing the items in 
                            the sequence, (2) there are errors
                            during serialization, (3) the sequence is in a closed state,
                            (4) in the case of a forward only sequence, a get or
                            write method has already been invoked on the current item,
                            or (5) the <code>os</code> parameter is <code>null</code></DL>
</DD>
</DL>
<HR>

<A NAME="writeSequence(java.io.Writer, java.util.Properties)"><!-- --></A><H3>
writeSequence</H3>
<PRE>
void <B>writeSequence</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A>&nbsp;ow,
                   <A HREF="http://download.oracle.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;props)
                   throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Serializes the sequence starting from the current position to a Writer
 according to the  <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>.

 Serialization parameters, which influence how serialization is
 performed, can be specified. Refer to the
 <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>
 and <i>Section 12 Serialization, XQuery
 API for Java (XQJ) 1.0</i> for more information.
 <br> 
 <br>
 Warning: When outputting to a <code>Writer</code>, make sure the writer's encoding
 matches the encoding parameter if specified as a property or the default
 encoding.
 <br>
 <br> 

 Reading the sequence during the serialization process performs implicit
 next operations to read the items. 

 After all items are written to the stream, the current position of the
 cursor is set to point after the last item.

 Also, in the case of forward only sequences, this method may only be
 called if the current item has not yet been read through any of the get
 or write methods.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ow</CODE> - the writer object into which the sequence is to be serialized<DD><CODE>props</CODE> - specifies the serialization parameters,
                            <code>null</code> is considered equivalent to an empty
                            <code>Properties</code> object
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) there are errors accessing the items in 
                            the sequence, (2) there are errors during serialization,
                            (3) the sequence is in a closed state,
                            (4) in the case of a forward only sequence, a get or
                            write method has already been invoked on the current item,
                            or (5) the <code>ow</code> parameter is <code>null</code></DL>
</DD>
</DL>
<HR>

<A NAME="writeSequenceToSAX(org.xml.sax.ContentHandler)"><!-- --></A><H3>
writeSequenceToSAX</H3>
<PRE>
void <B>writeSequenceToSAX</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/org/xml/sax/ContentHandler.html?is-external=true" title="class or interface in org.xml.sax">ContentHandler</A>&nbsp;saxhdlr)
                        throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Writes the entire sequence starting from the current position to a SAX
 handler, as described in <i>Section 12.2 Serializing an XDM instance
 into a SAX event stream, XQuery API for Java (XQJ) 1.0</i>.

 Note that the serialization process might fail, in which case a 
 <code>XQException</code> is thrown.  

 After all items are written to the stream, the current position of the
 cursor is set to point after the last item.

 Also, in the case of forward only sequences, this method may only be called
 if the current item has not yet been read through any of the get or write
 methods.

 The specified <code>org.xml.sax.ContentHandler</code> can optionally implement the
 <code>org.xml.sax.LexicalHandler</code> interface. An implementation must check if the
 specified <code>ContentHandler</code> implements <code>LexicalHandler</code>.
 If the handler is a <code>LexicalHandler</code> comment nodes are reported, otherwise
 they will be silently ignored.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>saxhdlr</CODE> - the SAX content handler, optionally a lexical handler
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) there are errors accessing any of the items
                            in the sequence, (2) the sequence is in a closed 
                            state, (3) in the case of a forward only sequence, a get or
                            write method has already been invoked on the current item, 
                            (4) in case of an error during serializing the XDM instance
                            into a SAX event stream, or (5) the <code>saxhdlr</code>
                            parameter is <code>null</code></DL>
</DD>
</DL>
<HR>

<A NAME="writeSequenceToResult(javax.xml.transform.Result)"><!-- --></A><H3>
writeSequenceToResult</H3>
<PRE>
void <B>writeSequenceToResult</B>(<A HREF="http://download.oracle.com/javase/6/docs/api/javax/xml/transform/Result.html?is-external=true" title="class or interface in javax.xml.transform">Result</A>&nbsp;result)
                           throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE>
<DL>
<DD>Writes the entire sequence starting from the current position to a
 <code>Result</code>. First the sequence is normalized as described in
 <a href="http://www.w3.org/TR/xslt-xquery-serialization/">
 <i>XSLT 2.0 and XQuery 1.0 serialization</i></a>.  Subsequently it is serialized
 to the <code>Result</code> object.<br>

 Note that the normalization process can fail, in which case an
 <code>XQException</code> is thrown. 

 An XQJ implementation must at least support the following
 implementations:
 <br>
 <ul>
   <li><code>javax.xml.transform.dom.DOMResult</code></li>
   <li><code>javax.xml.transform.sax.SAXResult</code></li>
   <li><code>javax.xml.transform.stream.StreamResult</code></li>
 </ul>
 <br>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>result</CODE> - the result object into which the sequence
                             is to be serialized
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if (1) there are errors accessing any of the items
                             in the sequence, (2) the sequence is in a closed 
                             state, (3) in the case of a forward only sequence, a get or
                             write method has already been invoked on the current item, 
                             (4) in case of an error while serializing the sequence
                             into the <code>Result</code> object, or (5) the
                             <code>result</code> parameter is <code>null</code></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/xml/xquery/XQResultSequence.html" title="interface in javax.xml.xquery"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/xml/xquery/XQSequenceType.html" title="interface in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?javax/xml/xquery/XQSequence.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="XQSequence.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.
</BODY>
</HTML>