blob: 5c73f67dfa98b94e533a9f4b0cca139a68acd770 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Sep 25 16:46:58 PDT 2003 -->
<TITLE>
XmlObject (XMLBeans Documentation)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.xmlbeans.XmlObject,XmlObject interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="XmlObject (XMLBeans Documentation)";
}
</SCRIPT>
<BODY BGCOLOR="white" onload="asd();">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<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="../../../org/apache/xmlbeans/XmlNOTATION.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlPositiveInteger.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XmlObject.html" TARGET="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;
<SCRIPT>
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.xmlbeans</FONT>
<BR>
Interface XmlObject</H2>
<DL>
<DT><B>All Superinterfaces:</B> <DD><A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html">XmlTokenSource</A></DD>
</DL>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../org/apache/xmlbeans/SimpleValue.html">SimpleValue</A>, <A HREF="../../../org/apache/xmlbeans/XmlAnySimpleType.html">XmlAnySimpleType</A>, <A HREF="../../../org/apache/xmlbeans/XmlAnyURI.html">XmlAnyURI</A>, <A HREF="../../../org/apache/xmlbeans/XmlBase64Binary.html">XmlBase64Binary</A>, <A HREF="../../../org/apache/xmlbeans/XmlBoolean.html">XmlBoolean</A>, <A HREF="../../../org/apache/xmlbeans/XmlByte.html">XmlByte</A>, <A HREF="../../../org/apache/xmlbeans/XmlDate.html">XmlDate</A>, <A HREF="../../../org/apache/xmlbeans/XmlDateTime.html">XmlDateTime</A>, <A HREF="../../../org/apache/xmlbeans/XmlDecimal.html">XmlDecimal</A>, <A HREF="../../../org/apache/xmlbeans/XmlDouble.html">XmlDouble</A>, <A HREF="../../../org/apache/xmlbeans/XmlDuration.html">XmlDuration</A>, <A HREF="../../../org/apache/xmlbeans/XmlENTITIES.html">XmlENTITIES</A>, <A HREF="../../../org/apache/xmlbeans/XmlENTITY.html">XmlENTITY</A>, <A HREF="../../../org/apache/xmlbeans/XmlFloat.html">XmlFloat</A>, <A HREF="../../../org/apache/xmlbeans/XmlGDay.html">XmlGDay</A>, <A HREF="../../../org/apache/xmlbeans/XmlGMonth.html">XmlGMonth</A>, <A HREF="../../../org/apache/xmlbeans/XmlGMonthDay.html">XmlGMonthDay</A>, <A HREF="../../../org/apache/xmlbeans/XmlGYear.html">XmlGYear</A>, <A HREF="../../../org/apache/xmlbeans/XmlGYearMonth.html">XmlGYearMonth</A>, <A HREF="../../../org/apache/xmlbeans/XmlHexBinary.html">XmlHexBinary</A>, <A HREF="../../../org/apache/xmlbeans/XmlID.html">XmlID</A>, <A HREF="../../../org/apache/xmlbeans/XmlIDREF.html">XmlIDREF</A>, <A HREF="../../../org/apache/xmlbeans/XmlIDREFS.html">XmlIDREFS</A>, <A HREF="../../../org/apache/xmlbeans/XmlInt.html">XmlInt</A>, <A HREF="../../../org/apache/xmlbeans/XmlInteger.html">XmlInteger</A>, <A HREF="../../../org/apache/xmlbeans/XmlLanguage.html">XmlLanguage</A>, <A HREF="../../../org/apache/xmlbeans/XmlLong.html">XmlLong</A>, <A HREF="../../../org/apache/xmlbeans/XmlName.html">XmlName</A>, <A HREF="../../../org/apache/xmlbeans/XmlNCName.html">XmlNCName</A>, <A HREF="../../../org/apache/xmlbeans/XmlNegativeInteger.html">XmlNegativeInteger</A>, <A HREF="../../../org/apache/xmlbeans/XmlNMTOKEN.html">XmlNMTOKEN</A>, <A HREF="../../../org/apache/xmlbeans/XmlNMTOKENS.html">XmlNMTOKENS</A>, <A HREF="../../../org/apache/xmlbeans/XmlNonNegativeInteger.html">XmlNonNegativeInteger</A>, <A HREF="../../../org/apache/xmlbeans/XmlNonPositiveInteger.html">XmlNonPositiveInteger</A>, <A HREF="../../../org/apache/xmlbeans/XmlNormalizedString.html">XmlNormalizedString</A>, <A HREF="../../../org/apache/xmlbeans/XmlNOTATION.html">XmlNOTATION</A>, <A HREF="../../../org/apache/xmlbeans/XmlPositiveInteger.html">XmlPositiveInteger</A>, <A HREF="../../../org/apache/xmlbeans/XmlQName.html">XmlQName</A>, <A HREF="../../../org/apache/xmlbeans/XmlShort.html">XmlShort</A>, <A HREF="../../../org/apache/xmlbeans/XmlString.html">XmlString</A>, <A HREF="../../../org/apache/xmlbeans/XmlTime.html">XmlTime</A>, <A HREF="../../../org/apache/xmlbeans/XmlToken.html">XmlToken</A>, <A HREF="../../../org/apache/xmlbeans/XmlUnsignedByte.html">XmlUnsignedByte</A>, <A HREF="../../../org/apache/xmlbeans/XmlUnsignedInt.html">XmlUnsignedInt</A>, <A HREF="../../../org/apache/xmlbeans/XmlUnsignedLong.html">XmlUnsignedLong</A>, <A HREF="../../../org/apache/xmlbeans/XmlUnsignedShort.html">XmlUnsignedShort</A></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../org/apache/xmlbeans/FilterXmlObject.html">FilterXmlObject</A></DD>
</DL>
<HR>
<DL>
<DT>public interface <B>XmlObject</B><DT>extends <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html">XmlTokenSource</A></DL>
<P>
Corresponds to the XML Schema
<a target="_blank" href="http://www.w3.org/TR/xmlschema-1/#key-urType">xs:anyType</a>,
the base type for all XML Beans.
<p>
Since all XML Schema types are translated into corresponding XML Bean
classes, and all Schema type derivation corresponds to Java class
inheritance, the fact that all Schema types derive from xs:anyType means
that all XML Bean classes derive from XmlObject.
<p>
On this base class you will find a number of common facilities that
all XML Bean classes provide:
<p>
<ul>
<li>Every XML Bean class has an inner Factory class for creating and parsing
instances, including XmlObject. Use <A HREF="../../../org/apache/xmlbeans/XmlObject.Factory.html"><CODE>XmlObject.Factory</CODE></A> itself
to produce untyped XML trees or XML trees that implement specific
subtypes of XmlObject depending on a recognized root document element.
If you depend on the automatic type inference, you will want to understand
the type inference issues described below.
<li>To write out an accurate XML file for the XML tree under this
XmlObject, use one of the <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)"><CODE>XmlTokenSource.save(org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)</CODE></A> methods,
or <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newInputStream()"><CODE>XmlTokenSource.newInputStream()</CODE></A> or <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newReader()"><CODE>XmlTokenSource.newReader()</CODE></A>.
Use <A HREF="../../../org/apache/xmlbeans/XmlObject.html#toString()"><CODE>toString()</CODE></A> to produce a pretty-printed representation of the
XML subtree under this XML Object. If you save interior portions of
an XML document, you will want to understand the inner contents
versus outer container issues described below.
<li>It is also simple to copy an XmlObject instance to or from a standard
DOM tree or SAX stream. Use <A HREF="../../../org/apache/xmlbeans/XmlObject.Factory.html#parse(org.w3c.dom.Node)"><CODE>XmlObject.Factory.parse(Node)</CODE></A>,
for example, to load from DOM; use <A HREF="../../../org/apache/xmlbeans/XmlObject.Factory.html#newXmlSaxHandler()"><CODE>XmlObject.Factory.newXmlSaxHandler()</CODE></A>
to load from SAX; use <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newDomNode()"><CODE>XmlTokenSource.newDomNode()</CODE></A> to save to DOM; and use
<A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)"><CODE>XmlTokenSource.save(org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)</CODE></A>
to save to SAX.
<li>Use <A HREF="../../../org/apache/xmlbeans/XmlObject.html#validate()"><CODE>validate()</CODE></A> to validate the subtree of XML under this
XML Object. If you wish to get information about the location
and reason for validation errors, see <A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setErrorListener(java.util.Collection)"><CODE>XmlOptions.setErrorListener(java.util.Collection)</CODE></A>,
and use <A HREF="../../../org/apache/xmlbeans/XmlObject.html#validate(org.apache.xmlbeans.XmlOptions)"><CODE>validate(XmlOptions)</CODE></A>.
<li>Use <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newCursor()"><CODE>XmlTokenSource.newCursor()</CODE></A> to access the full XML infoset, for example,
if you need to determine interleaved element order or manipulate
annotations, comments, or mixed content. See <A HREF="../../../org/apache/xmlbeans/XmlCursor.html"><CODE>XmlCursor</CODE></A>.
<li>Use <A HREF="../../../org/apache/xmlbeans/XmlObject.html#selectPath(java.lang.String)"><CODE>selectPath(java.lang.String)</CODE></A> to find other XmlObjects in the subtree underneath
this XmlObject using relative XPaths. (In selectPath, "." indicates
the current element or attribute.)
</ul>
<p>
Type inference. When using <A HREF="../../../org/apache/xmlbeans/XmlObject.Factory.html"><CODE>XmlObject.Factory</CODE></A> to parse XML documents,
the actual document type is not <A HREF="../../../org/apache/xmlbeans/XmlObject.html#type"><CODE>type</CODE></A> itself, but a subtype
based on the contents of the parsed document. If the parsed document
contains a recognized root document element, then the actual type of the
loaded instance will be the matching Document type. For example:
<pre>
XmlObject xobj = XmlObject.Factory.parse(myDocument);
if (xobj instanceof MyOrderDocument) // starts w/ &lt;my-order&gt;
{
MyOrderDocument mydoc = (MyOrderDocument)xobj;
if (!xobj.validate())
System.out.println("Not a valid my-order document");
}
else
{
System.out.println("Not a my-order document");
}
</pre>
Every XML Bean class has its own inner Factory class,
so if you actually know exactly which XML Bean document type
you want to load as in the example above, you should use the
the specific XML Bean Factory class instead. For example:
<pre>
MyOrderDocument mydoc = MyOrderDocument.Factory.parse(myDocument);
</pre>
The code above will throw an exception if the parsed document
does not begin with the proper (my-order) element.
<p>
Inner versus outer. An XmlObject represents the
<em>contents</em> of an element or attribute, <em>not</em> the element
or attribute itself. So when you validate or save an XmlObject, you
are validating or saving its contents, not its container. For example,
if the XmlObject represents the contents of an element which happens
to itself be in the wrong order relative to its siblings, validate will
not complain about the misplacement of the element itself. On the other hand, if
elements <em>within</em> the XmlObject are in the wrong order, validate
will complain. Similarly, when saving the contents of an interior
XmlObject, it is the contents of an element, not the element itself,
which is saved by default.
<p>
Reading and writing fragments. When reading or writing the contents of a
whole XML document, the standard XML reprentation for a document is used.
However, there is no standard concrete XML representation for "just the
contents" of an interior element or attribute. So when one is needed,
the tag &lt;xml-fragment&gt; is used to wrap the contents. This tag is used
can also be used to load just the contents for an XmlObject document fragment
of arbitrary type. If you wish to save out the XmlObject's container element
along with its contents, use <A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setSaveOuter()"><CODE>XmlOptions.setSaveOuter()</CODE></A>.
<p>
Implementing XmlObject. The XMLBeans library does not support arbitrary
implementations of XmlObject - in almost all cases, you should only use
the implementations of XmlObject provided by the XMLBeans compiler itself.
If you need to implement XmlObject yourself, you should subclass
FilterXmlObject in order to delegate to another underlying XmlObject
implementation. This technique will allow you to use your code unchanged
with future versions of XMLBeans that add additional methods on XmlObject.
<P>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.Factory.html">XmlObject.Factory</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Static factory class for creating new instances.</TD>
</TR>
</TABLE>
&nbsp;
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#EQUAL">EQUAL</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EQUAL is 0.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#GREATER_THAN">GREATER_THAN</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GREATER_THAN is 1.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#LESS_THAN">LESS_THAN</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LESS_THAN is -1.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#NOT_EQUAL">NOT_EQUAL</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NOT_EQUAL is 2.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../org/apache/xmlbeans/SchemaType.html">SchemaType</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#type">type</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The constant <A HREF="../../../org/apache/xmlbeans/SchemaType.html"><CODE>SchemaType</CODE></A> object representing this schema type.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#changeType(org.apache.xmlbeans.SchemaType)">changeType</A></B>(<A HREF="../../../org/apache/xmlbeans/SchemaType.html">SchemaType</A>&nbsp;newType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Changes the schema type associated with this data and
returns a new XmlObject instance whose schemaType is the
new type.</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="../../../org/apache/xmlbeans/XmlObject.html#compareTo(java.lang.Object)">compareTo</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Impelements the Comparable interface by comparing two simple
xml values based on their standard XML schema ordering.</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="../../../org/apache/xmlbeans/XmlObject.html#compareValue(org.apache.xmlbeans.XmlObject)">compareValue</A></B>(<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This comparison method is similar to compareTo, but rather
than throwing a ClassCastException when two values are incomparable,
it returns the number 2.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#copy()">copy</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a deep copy of this XmlObject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#execQuery(java.lang.String)">execQuery</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;query)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Executes a query.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#execQuery(java.lang.String, org.apache.xmlbeans.XmlOptions)">execQuery</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;query,
<A HREF="../../../org/apache/xmlbeans/XmlOptions.html">XmlOptions</A>&nbsp;options)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Executes a query with options.</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="../../../org/apache/xmlbeans/XmlObject.html#isImmutable()">isImmutable</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;True if the value is an immutable value.</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="../../../org/apache/xmlbeans/XmlObject.html#isNil()">isNil</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;True if the value is nil.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/SchemaType.html">SchemaType</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#schemaType()">schemaType</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The schema type for this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#selectPath(java.lang.String)">selectPath</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;path)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Selects a path.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#selectPath(java.lang.String, org.apache.xmlbeans.XmlOptions)">selectPath</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;path,
<A HREF="../../../org/apache/xmlbeans/XmlOptions.html">XmlOptions</A>&nbsp;options)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Selects a path, applying options.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#set(org.apache.xmlbeans.XmlObject)">set</A></B>(<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>&nbsp;srcObj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the value/type of this XmlObject to be a copy of the source
XmlObject.</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="../../../org/apache/xmlbeans/XmlObject.html#setNil()">setNil</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the value to nil.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xmlbeans/XmlObject.html#toString()">toString</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an XML string for this XML object.</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="../../../org/apache/xmlbeans/XmlObject.html#validate()">validate</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if the contents of this object are valid
accoring to schemaType().</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="../../../org/apache/xmlbeans/XmlObject.html#validate(org.apache.xmlbeans.XmlOptions)">validate</A></B>(<A HREF="../../../org/apache/xmlbeans/XmlOptions.html">XmlOptions</A>&nbsp;options)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Just like validate(), but with options.</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="../../../org/apache/xmlbeans/XmlObject.html#valueEquals(org.apache.xmlbeans.XmlObject)">valueEquals</A></B>(<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;True if the xml values are equal.</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="../../../org/apache/xmlbeans/XmlObject.html#valueHashCode()">valueHashCode</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.xmlbeans.XmlTokenSource"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from interface org.apache.xmlbeans.<A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html">XmlTokenSource</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#documentProperties()">documentProperties</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#monitor()">monitor</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newCursor()">newCursor</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newDomNode()">newDomNode</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newDomNode(org.apache.xmlbeans.XmlOptions)">newDomNode</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newInputStream()">newInputStream</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newInputStream(org.apache.xmlbeans.XmlOptions)">newInputStream</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newReader()">newReader</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newReader(org.apache.xmlbeans.XmlOptions)">newReader</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newXMLInputStream()">newXMLInputStream</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#newXMLInputStream(org.apache.xmlbeans.XmlOptions)">newXMLInputStream</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, org.apache.xmlbeans.XmlOptions)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(java.io.File)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(java.io.File, org.apache.xmlbeans.XmlOptions)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(java.io.OutputStream)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(java.io.OutputStream, org.apache.xmlbeans.XmlOptions)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(java.io.Writer)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#save(java.io.Writer, org.apache.xmlbeans.XmlOptions)">save</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#xmlText()">xmlText</A>, <A HREF="../../../org/apache/xmlbeans/XmlTokenSource.html#xmlText(org.apache.xmlbeans.XmlOptions)">xmlText</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="type"><!-- --></A><H3>
type</H3>
<PRE>
public static final <A HREF="../../../org/apache/xmlbeans/SchemaType.html">SchemaType</A> <B>type</B></PRE>
<DL>
<DD>The constant <A HREF="../../../org/apache/xmlbeans/SchemaType.html"><CODE>SchemaType</CODE></A> object representing this schema type.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="LESS_THAN"><!-- --></A><H3>
LESS_THAN</H3>
<PRE>
public static final int <B>LESS_THAN</B></PRE>
<DL>
<DD>LESS_THAN is -1. See <A HREF="../../../org/apache/xmlbeans/XmlObject.html#compareValue(org.apache.xmlbeans.XmlObject)"><CODE>compareValue(org.apache.xmlbeans.XmlObject)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.apache.xmlbeans.XmlObject.LESS_THAN">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="EQUAL"><!-- --></A><H3>
EQUAL</H3>
<PRE>
public static final int <B>EQUAL</B></PRE>
<DL>
<DD>EQUAL is 0. See <A HREF="../../../org/apache/xmlbeans/XmlObject.html#compareValue(org.apache.xmlbeans.XmlObject)"><CODE>compareValue(org.apache.xmlbeans.XmlObject)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.apache.xmlbeans.XmlObject.EQUAL">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="GREATER_THAN"><!-- --></A><H3>
GREATER_THAN</H3>
<PRE>
public static final int <B>GREATER_THAN</B></PRE>
<DL>
<DD>GREATER_THAN is 1. See <A HREF="../../../org/apache/xmlbeans/XmlObject.html#compareValue(org.apache.xmlbeans.XmlObject)"><CODE>compareValue(org.apache.xmlbeans.XmlObject)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.apache.xmlbeans.XmlObject.GREATER_THAN">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="NOT_EQUAL"><!-- --></A><H3>
NOT_EQUAL</H3>
<PRE>
public static final int <B>NOT_EQUAL</B></PRE>
<DL>
<DD>NOT_EQUAL is 2. See <A HREF="../../../org/apache/xmlbeans/XmlObject.html#compareValue(org.apache.xmlbeans.XmlObject)"><CODE>compareValue(org.apache.xmlbeans.XmlObject)</CODE></A>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.apache.xmlbeans.XmlObject.NOT_EQUAL">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="schemaType()"><!-- --></A><H3>
schemaType</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/SchemaType.html">SchemaType</A> <B>schemaType</B>()</PRE>
<DL>
<DD>The schema type for this instance. This is a permanent,
unchanging property of the instance.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="validate()"><!-- --></A><H3>
validate</H3>
<PRE>
public boolean <B>validate</B>()</PRE>
<DL>
<DD>Returns true if the contents of this object are valid
accoring to schemaType().
<p>
Does a deep validation of the entire subtree under the
object, but does not validate the parents or siblings
of the object if the object is in the interior of an xml
tree.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="validate(org.apache.xmlbeans.XmlOptions)"><!-- --></A><H3>
validate</H3>
<PRE>
public boolean <B>validate</B>(<A HREF="../../../org/apache/xmlbeans/XmlOptions.html">XmlOptions</A>&nbsp;options)</PRE>
<DL>
<DD><p>Just like validate(), but with options.</p>
<p>If you wish to collect error messages and locations while validating,
use the <A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setErrorListener(java.util.Collection)"><CODE>XmlOptions.setErrorListener(java.util.Collection)</CODE></A> method. With that method,
you can specify an object in which to store messages related to validation.
The following is a simple example.</p>
<pre>
// Create an XmlOptions instance and set the error listener.
XmlOptions validateOptions = new XmlOptions();
ArrayList errorList = new ArrayList();
validateOptions.setErrorListener(errorList);
// Validate the XML.
boolean isValid = newEmp.validate(validateOptions);
// If the XML isn't valid, loop through the listener's contents,
// printing contained messages.
if (!isValid)
{
for (int i = 0; i < errorList.size(); i++)
{
XmlError error = (XmlError)errorList.get(i);
System.out.println("\n");
System.out.println("Message: " + error.getMessage() + "\n");
System.out.println("Location of invalid XML: " +
error.getCursorLocation().xmlText() + "\n");
}
}
</pre>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>options</CODE> - An object that implements the <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html"><CODE>Collection</CODE></A> interface.</DL>
</DD>
</DL>
<HR>
<A NAME="selectPath(java.lang.String)"><!-- --></A><H3>
selectPath</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[] <B>selectPath</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;path)</PRE>
<DL>
<DD>Selects a path. Path can be a string or precompiled path String.
<p>
The path must be a relative path, where "." represents the
element or attribute containg this XmlObject, and it must select
only other elements or attributes. If a non-element or non-attribute
is selected, an unchecked exception is thrown.
<p>
The array that is returned contains all the selected
XmlObjects, within the same document, listed in document
order. The actual array type of the result is inferred
from the closest common base type of selected results.
<p>
Here is an example of usage. Suppose we have a global
element definition for "owner" whose type is "person":
<pre>
&lt;schema targetNamespace="http://openuri.org/sample">
&lt;element name="owner" type="person"/>
&lt;complexType name="person">
[...]
&lt;/complexType>
&lt;/schema>
</pre>
and suppose "owner" tags can be scattered throughout the
document. Then we can write the following code to find
them all:
<pre>
import org.openuri.sample.Person;
import org.apache.xmlbeans.*;
[...]
XmlObject xobj = XmlObject.Factory.parse(myFile);
Person[] results;
results = (Person[])xobj.selectPath(
"declare namespace s='http://www.openuri.org/sample' " +
".//s:owner");
</pre>
Notice the way in which namespace declarations are done in XPath 2.0.
Since XPath can only navigate within an XML document - it cannot
construct new XML - the resulting XmlObjects all reside in
the same XML document as this XmlObject itself.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="selectPath(java.lang.String, org.apache.xmlbeans.XmlOptions)"><!-- --></A><H3>
selectPath</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[] <B>selectPath</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;path,
<A HREF="../../../org/apache/xmlbeans/XmlOptions.html">XmlOptions</A>&nbsp;options)</PRE>
<DL>
<DD>Selects a path, applying options.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/apache/xmlbeans/XmlObject.html#selectPath(java.lang.String)"><CODE>selectPath(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="execQuery(java.lang.String)"><!-- --></A><H3>
execQuery</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[] <B>execQuery</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;query)</PRE>
<DL>
<DD>Executes a query. Query can be a string or precompiled query String.
<p>
An XQuery is very similar to an XPath, except that it also permits
construction of new XML. As a result, the XmlObjects that are
returned from execQuery are in newly created documents, separate
from the XmlObject on which the query is executed.
<p>
Syntax and usage is otherwise similar to selectPath.
<p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/apache/xmlbeans/XmlObject.html#selectPath(java.lang.String)"><CODE>selectPath(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="execQuery(java.lang.String, org.apache.xmlbeans.XmlOptions)"><!-- --></A><H3>
execQuery</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>[] <B>execQuery</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A>&nbsp;query,
<A HREF="../../../org/apache/xmlbeans/XmlOptions.html">XmlOptions</A>&nbsp;options)</PRE>
<DL>
<DD>Executes a query with options.
Use the <em>options</em> parameter to specify the following:</p>
<table>
<tr><th>To specify this</th><th>Use this method</th></tr>
<tr>
<td>The document type for the root element.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setDocumentType(org.apache.xmlbeans.SchemaType)"><CODE>XmlOptions.setDocumentType(org.apache.xmlbeans.SchemaType)</CODE></A></td>
</tr>
<tr>
<td>To replace the document element with the specified QName when constructing the
resulting document.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setLoadReplaceDocumentElement(javax.xml.namespace.QName)"><CODE>XmlOptions.setLoadReplaceDocumentElement(javax.xml.namespace.QName)</CODE></A></td>
</tr>
<tr>
<td>To strip all insignificant whitespace when constructing a document.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setLoadStripWhitespace()"><CODE>XmlOptions.setLoadStripWhitespace()</CODE></A></td>
</tr>
<tr>
<td>To strip all comments when constructing a document.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setLoadStripComments()"><CODE>XmlOptions.setLoadStripComments()</CODE></A></td>
</tr>
<tr>
<td>To strip all processing instructions when constructing a document.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setLoadStripProcinsts()"><CODE>XmlOptions.setLoadStripProcinsts()</CODE></A></td>
</tr>
<tr>
<td>A map of namespace URI substitutions to use when constructing a document.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setLoadSubstituteNamespaces(java.util.Map)"><CODE>XmlOptions.setLoadSubstituteNamespaces(java.util.Map)</CODE></A></td>
</tr>
<tr>
<td>Additional namespace mappings to be added when constructing a document.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setLoadAdditionalNamespaces(java.util.Map)"><CODE>XmlOptions.setLoadAdditionalNamespaces(java.util.Map)</CODE></A></td>
</tr>
<tr>
<td>To trim the underlying XML text buffer immediately after constructing
a document, resulting in a smaller memory footprint.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setLoadTrimTextBuffer()"><CODE>XmlOptions.setLoadTrimTextBuffer()</CODE></A></td>
</tr>
<tr>
<td>Whether value facets should be checked as they are set.</td>
<td><A HREF="../../../org/apache/xmlbeans/XmlOptions.html#setValidateOnSet()"><CODE>XmlOptions.setValidateOnSet()</CODE></A></td>
</tr>
</table>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>query</CODE> - The XQuery expression.<DD><CODE>options</CODE> - Options as described.<DT><B>See Also:</B><DD><A HREF="../../../org/apache/xmlbeans/XmlObject.html#execQuery(java.lang.String)"><CODE>execQuery(String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="changeType(org.apache.xmlbeans.SchemaType)"><!-- --></A><H3>
changeType</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A> <B>changeType</B>(<A HREF="../../../org/apache/xmlbeans/SchemaType.html">SchemaType</A>&nbsp;newType)</PRE>
<DL>
<DD>Changes the schema type associated with this data and
returns a new XmlObject instance whose schemaType is the
new type.
<p>
Returns null if the type change is not allowed. Certain
type changes may be prohibited on the interior of an xml
tree due to schema type system constraints (that is, due
to a parent container within which the newly specified
type is not permissible), but there are no constraints
at the roottype changes are never
prohibited at the root of an xml tree.
<p>
If the type change is allowed, then the new XmlObject should
be used rather than the old one. The old XmlObject instance and
any other XmlObject instances in the subtree are permanently
invalidated and should not be used. (They will return
InvalidStateException if you try to use them.)
If a type change is done on the interior of an Xml
tree, then xsi:type attributes are updated as needed.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isNil()"><!-- --></A><H3>
isNil</H3>
<PRE>
public boolean <B>isNil</B>()</PRE>
<DL>
<DD>True if the value is nil. Note that in order to be nil,
the value must be in an element, and the element containing
the value must be marked as nillable in the schema.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setNil()"><!-- --></A><H3>
setNil</H3>
<PRE>
public void <B>setNil</B>()</PRE>
<DL>
<DD>Sets the value to nil. The element containing the value must
be marked as nillable in the schema.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String</A> <B>toString</B>()</PRE>
<DL>
<DD>Returns an XML string for this XML object.
<p>
The string is pretty-printed. If you want a non-pretty-printed
string, or if you want to control options precisely, use the
xmlText() methods.
<p>
Note that when producing XML any object other than very root of the
document, then you are guaranteed to be looking at only a fragment
of XML, i.e., just the contents of an element or attribute, and
and we will produce a string that starts with an <code>&lt;xml-fragment&gt;</code> tag.
The XmlOptions.setSaveOuter() option on xmlText can be used to produce
the actual element name above the object if you wish.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#toString()">toString</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html">Object</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="isImmutable()"><!-- --></A><H3>
isImmutable</H3>
<PRE>
public boolean <B>isImmutable</B>()</PRE>
<DL>
<DD>True if the value is an immutable value. Immutable values do not
have a position in a tree; rather, they are stand-alone simple type
values. If the object is immutable, the equals() methods tests for
value equality, and the object can be used as the key for a hash.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="set(org.apache.xmlbeans.XmlObject)"><!-- --></A><H3>
set</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A> <B>set</B>(<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>&nbsp;srcObj)</PRE>
<DL>
<DD>Set the value/type of this XmlObject to be a copy of the source
XmlObject. Because the type of the source may be different than this
target, this XmlObject may become defunct. In this case the new
XmlObject is returned. If no type change happens, the same this will be
returned.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="copy()"><!-- --></A><H3>
copy</H3>
<PRE>
public <A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A> <B>copy</B>()</PRE>
<DL>
<DD>Returns a deep copy of this XmlObject. The returned object has the
same type as the current object, and has all the content of
the XML document underneath the current object. Note that
any parts of the XML document above or outside this XmlObject are
not copied.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="valueEquals(org.apache.xmlbeans.XmlObject)"><!-- --></A><H3>
valueEquals</H3>
<PRE>
public boolean <B>valueEquals</B>(<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>&nbsp;obj)</PRE>
<DL>
<DD>True if the xml values are equal. Two different objects
(which are distinguished by equals(obj) == false) may of
course have equal values (valueEquals(obj) == true).
<p>
Usually this method can be treated as an ordinary equvalence
relation, but actually it is not is not transitive.
Here is a precise specification:
<p>
There are two categories of XML object: objects with a known
instance type, and objects whose only known type is one of the
ur-types (either AnyType or AnySimpleType). The first category
is compared in terms of logical value spaces, and the second
category is compared lexically.
<p>
Within each of these two categories, valueEquals is a well-behaved
equivalence relation. However, when comparing an object of known
type with an object with ur-type, the comparison is done by attempting
to convert the lexical form of the ur-typed object into the other
type, and then comparing the results. Ur-typed objects are therefore
treated as lexical wildcards and may be equal to objects in different
value spaces, even though the objects in different value spaces are
not equal to each other.
<p>
For example, the anySimpleType value "1" will compare as an
equalValue to the string "1", the float value "1.0", the double
value "1.0", the decimal "1", and the GYear "1", even though
all these objects will compare unequal to each other since they
lie in different value spaces.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="valueHashCode()"><!-- --></A><H3>
valueHashCode</H3>
<PRE>
public int <B>valueHashCode</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="compareTo(java.lang.Object)"><!-- --></A><H3>
compareTo</H3>
<PRE>
public int <B>compareTo</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html">Object</A>&nbsp;obj)</PRE>
<DL>
<DD>Impelements the Comparable interface by comparing two simple
xml values based on their standard XML schema ordering.
Throws a ClassCastException if no standard ordering applies,
or if the two values are incomparable within a partial order.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="compareValue(org.apache.xmlbeans.XmlObject)"><!-- --></A><H3>
compareValue</H3>
<PRE>
public int <B>compareValue</B>(<A HREF="../../../org/apache/xmlbeans/XmlObject.html">XmlObject</A>&nbsp;obj)</PRE>
<DL>
<DD>This comparison method is similar to compareTo, but rather
than throwing a ClassCastException when two values are incomparable,
it returns the number 2. The result codes are -1 if this object
is less than obj, 1 if this object is greater than obj, zero if
the objects are equal, and 2 if the objects are incomparable.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<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="../../../org/apache/xmlbeans/XmlNOTATION.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/apache/xmlbeans/XmlPositiveInteger.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="XmlObject.html" TARGET="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;
<SCRIPT>
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>