1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Mar 15 14:18:28 EST 2001 -->
<TITLE>
Xalan-Java 2: Class DOMHelper
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 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 ID="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DOMHelper.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/apache/xpath/DOM2Helper.html"><B>PREV CLASS</B></A>
<A HREF="../../../org/apache/xpath/Expression.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>
<A HREF="DOMHelper.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.xpath</FONT>
<BR>
Class DOMHelper</H2>
<PRE>
java.lang.Object
|
+--<B>org.apache.xpath.DOMHelper</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../org/apache/xpath/DOM2Helper.html">DOM2Helper</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>DOMHelper</B><DT>extends java.lang.Object</DL>
<P>
<i><font size="-1" color="#00FF00">**For advanced use only** </font></i><meta name="usage" content="advanced"/>
This class provides a front-end to DOM implementations, providing
a number of utility functions that either aren't yet standardized
by the DOM spec or that are defined in optional DOM modules and
hence may not be present in all DOMs.
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#DOMHelper()">DOMHelper</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== 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> <A HREF="../../../org/w3c/dom/Document.html">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#createDocument()">createDocument</A></B>()</CODE>
<BR>
DOM Level 1 did not have a standard mechanism for creating a new
Document object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../org/w3c/dom/Document.html">Document</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getDOMFactory()">getDOMFactory</A></B>()</CODE>
<BR>
Retrieve the factory object required to create DOM nodes
in the result tree.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../org/w3c/dom/Element.html">Element</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getElementByID(java.lang.String, org.w3c.dom.Document)">getElementByID</A></B>(java.lang.String id,
<A HREF="../../../org/w3c/dom/Document.html">Document</A> doc)</CODE>
<BR>
Given an ID, return the element.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getExpandedAttributeName(org.w3c.dom.Attr)">getExpandedAttributeName</A></B>(<A HREF="../../../org/w3c/dom/Attr.html">Attr</A> attr)</CODE>
<BR>
Returns the attribute name with the namespace prefix (if any) replaced
by the Namespace URI it was bound to.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getExpandedElementName(org.w3c.dom.Element)">getExpandedElementName</A></B>(<A HREF="../../../org/w3c/dom/Element.html">Element</A> elem)</CODE>
<BR>
Returns the element name with the namespace prefix (if any) replaced
by the Namespace URI it was bound to.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> short</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getLevel(org.w3c.dom.Node)">getLevel</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</CODE>
<BR>
<i><font size="-1" color="#FF0000">**For internal use only** </font></i><meta name="usage" content="internal"/>
Get the depth level of this node in the tree (equals 1 for
a parentless node).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getLocalNameOfNode(org.w3c.dom.Node)">getLocalNameOfNode</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</CODE>
<BR>
Returns the local name of the given node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getNamespaceForPrefix(java.lang.String, org.w3c.dom.Element)">getNamespaceForPrefix</A></B>(java.lang.String prefix,
<A HREF="../../../org/w3c/dom/Element.html">Element</A> namespaceContext)</CODE>
<BR>
Given an XML Namespace prefix and a context in which the prefix
is to be evaluated, return the Namespace Name this prefix was
bound to.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getNamespaceOfNode(org.w3c.dom.Node)">getNamespaceOfNode</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</CODE>
<BR>
Returns the namespace of the given node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getNodeData(org.w3c.dom.Node)">getNodeData</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)</CODE>
<BR>
Get the textual contents of the node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getNodeData(org.w3c.dom.Node, org.apache.xml.utils.FastStringBuffer)">getNodeData</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node,
<A HREF="../../../org/apache/xml/utils/FastStringBuffer.html">FastStringBuffer</A> buf)</CODE>
<BR>
Retrieve the text content of a DOM subtree, appending it into a
user-supplied FastStringBuffer object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../org/w3c/dom/Node.html">Node</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getParentOfNode(org.w3c.dom.Node)">getParentOfNode</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)</CODE>
<BR>
Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
parent for other nodes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../org/w3c/dom/Node.html">Node</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getRoot(org.w3c.dom.Node)">getRoot</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)</CODE>
<BR>
<B>Deprecated.</B> <I></I> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../org/w3c/dom/Node.html">Node</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getRootNode(org.w3c.dom.Node)">getRootNode</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</CODE>
<BR>
Get the root node of the document tree, regardless of
whether or not the node passed in is a document node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getUniqueID(org.w3c.dom.Node)">getUniqueID</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)</CODE>
<BR>
Supports the XPath function GenerateID by returning a unique
identifier string for any given DOM Node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#getUnparsedEntityURI(java.lang.String, org.w3c.dom.Document)">getUnparsedEntityURI</A></B>(java.lang.String name,
<A HREF="../../../org/w3c/dom/Document.html">Document</A> doc)</CODE>
<BR>
The getUnparsedEntityURI function returns the URI of the unparsed
entity with the specified name in the same document as the context
node (see [3.3 Unparsed Entities]).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#isIgnorableWhitespace(org.w3c.dom.Text)">isIgnorableWhitespace</A></B>(<A HREF="../../../org/w3c/dom/Text.html">Text</A> node)</CODE>
<BR>
<B>Deprecated.</B> <I></I> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#isNamespaceNode(org.w3c.dom.Node)">isNamespaceNode</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</CODE>
<BR>
Test whether the given node is a namespace decl node.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#isNodeAfter(org.w3c.dom.Node, org.w3c.dom.Node)">isNodeAfter</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node1,
<A HREF="../../../org/w3c/dom/Node.html">Node</A> node2)</CODE>
<BR>
Figure out whether node2 should be considered as being later
in the document than node1, in Document Order as defined
by the XPath model.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#setDOMFactory(org.w3c.dom.Document)">setDOMFactory</A></B>(<A HREF="../../../org/w3c/dom/Document.html">Document</A> domFactory)</CODE>
<BR>
Store the factory object required to create DOM nodes
in the result tree.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/xpath/DOMHelper.html#shouldStripSourceNode(org.w3c.dom.Node)">shouldStripSourceNode</A></B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> textNode)</CODE>
<BR>
<i><font size="-1" color="#00FF00">**For advanced use only** </font></i><meta name="usage" content="advanced"/>
Tells, through the combination of the default-space attribute
on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the
xml:space attribute, whether or not extra whitespace should be stripped
from the node.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="DOMHelper()"><!-- --></A><H3>
DOMHelper</H3>
<PRE>
public <B>DOMHelper</B>()</PRE>
<DL>
</DL>
<!-- ============ 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="createDocument()"><!-- --></A><H3>
createDocument</H3>
<PRE>
public <A HREF="../../../org/w3c/dom/Document.html">Document</A> <B>createDocument</B>()</PRE>
<DL>
<DD>DOM Level 1 did not have a standard mechanism for creating a new
Document object. This function provides a DOM-implementation-independent
abstraction for that for that concept. It's typically used when
outputting a new DOM as the result of an operation.
<p>
TODO: This isn't directly compatable with DOM Level 2.
The Level 2 createDocument call also creates the root
element, and thus requires that you know what that element will be
before creating the Document. We should think about whether we want
to change this code, and the callers, so we can use the DOM's own
method. (It's also possible that DOM Level 3 may relax this
sequence, but you may give up some intelligence in the DOM by
doing so; the intent was that knowing the document type and root
element might let the DOM automatically switch to a specialized
subclass for particular kinds of documents.)<DD><DL>
<DT><B>Returns:</B><DD>The newly created DOM Document object, with no children, or
null if we can't find a DOM implementation that permits creating
new empty Documents.</DL>
</DD>
</DL>
<HR>
<A NAME="shouldStripSourceNode(org.w3c.dom.Node)"><!-- --></A><H3>
shouldStripSourceNode</H3>
<PRE>
public boolean <B>shouldStripSourceNode</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> textNode)
throws <A HREF="../../../javax/xml/transform/TransformerException.html">TransformerException</A></PRE>
<DL>
<DD><i><font size="-1" color="#00FF00">**For advanced use only** </font></i><meta name="usage" content="advanced"/>
Tells, through the combination of the default-space attribute
on xsl:stylesheet, xsl:strip-space, xsl:preserve-space, and the
xml:space attribute, whether or not extra whitespace should be stripped
from the node. Literal elements from template elements should
<em>not</em> be tested with this function.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>textNode</CODE> - A text node from the source tree.<DT><B>Returns:</B><DD>true if the text node should be stripped of extra whitespace.<DT><B>Throws:</B><DD><A HREF="../../../javax/xml/transform/TransformerException.html">TransformerException</A> - </DL>
</DD>
</DL>
<HR>
<A NAME="getUniqueID(org.w3c.dom.Node)"><!-- --></A><H3>
getUniqueID</H3>
<PRE>
public java.lang.String <B>getUniqueID</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)</PRE>
<DL>
<DD>Supports the XPath function GenerateID by returning a unique
identifier string for any given DOM Node.
<p>
Warning: The base implementation uses the Node object's hashCode(),
which is NOT guaranteed to be unique. If that method hasn't been
overridden in this DOM ipmlementation, most Java implementions will
derive it from the object's address and should be OK... but if
your DOM uses a different definition of hashCode (eg hashing the
contents of the subtree), or if your DOM may have multiple objects
that represent a single Node in the data structure (eg via proxying),
you may need to find another way to assign a unique identifier.
<p>
Also, be aware that if nodes are destroyed and recreated, there is
an open issue regarding whether an ID may be reused. Currently
we're assuming that the input document is stable for the duration
of the XPath/XSLT operation, so this shouldn't arise in this context.
<p>
(DOM Level 3 is investigating providing a unique node "key", but
that won't help Level 1 and Level 2 implementations.)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - whose identifier you want to obtain<DT><B>Returns:</B><DD>a string which should be different for every Node object.</DL>
</DD>
</DL>
<HR>
<A NAME="isNodeAfter(org.w3c.dom.Node, org.w3c.dom.Node)"><!-- --></A><H3>
isNodeAfter</H3>
<PRE>
public boolean <B>isNodeAfter</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node1,
<A HREF="../../../org/w3c/dom/Node.html">Node</A> node2)</PRE>
<DL>
<DD>Figure out whether node2 should be considered as being later
in the document than node1, in Document Order as defined
by the XPath model. This may not agree with the ordering defined
by other XML applications.
<p>
There are some cases where ordering isn't defined, and neither are
the results of this function -- though we'll generally return true.
TODO: Make sure this does the right thing with attribute nodes!!!<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node1</CODE> - DOM Node to perform position comparison on.<DD><CODE>node2</CODE> - DOM Node to perform position comparison on .<DT><B>Returns:</B><DD>false if node2 comes before node1, otherwise return true.
You can think of this as
<code>(node1.documentOrderPosition <= node2.documentOrderPosition)</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="getLevel(org.w3c.dom.Node)"><!-- --></A><H3>
getLevel</H3>
<PRE>
public short <B>getLevel</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</PRE>
<DL>
<DD><i><font size="-1" color="#FF0000">**For internal use only** </font></i><meta name="usage" content="internal"/>
Get the depth level of this node in the tree (equals 1 for
a parentless node).<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - Node to be examined.<DT><B>Returns:</B><DD>the number of ancestors, plus one</DL>
</DD>
</DL>
<HR>
<A NAME="getNamespaceForPrefix(java.lang.String, org.w3c.dom.Element)"><!-- --></A><H3>
getNamespaceForPrefix</H3>
<PRE>
public java.lang.String <B>getNamespaceForPrefix</B>(java.lang.String prefix,
<A HREF="../../../org/w3c/dom/Element.html">Element</A> namespaceContext)</PRE>
<DL>
<DD>Given an XML Namespace prefix and a context in which the prefix
is to be evaluated, return the Namespace Name this prefix was
bound to. Note that DOM Level 3 is expected to provide a version of
this which deals with the DOM's "early binding" behavior.
Default handling:<DD><DL>
<DT><B>Parameters:</B><DD><CODE>prefix</CODE> - String containing namespace prefix to be resolved,
without the ':' which separates it from the localname when used
in a Node Name. The empty sting signifies the default namespace
at this point in the document.<DD><CODE>namespaceContext</CODE> - Element which provides context for resolution.
(We could extend this to work for other nodes by first seeking their
nearest Element ancestor.)<DT><B>Returns:</B><DD>a String containing the Namespace URI which this prefix
represents in the specified context.</DL>
</DD>
</DL>
<HR>
<A NAME="getNamespaceOfNode(org.w3c.dom.Node)"><!-- --></A><H3>
getNamespaceOfNode</H3>
<PRE>
public java.lang.String <B>getNamespaceOfNode</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</PRE>
<DL>
<DD>Returns the namespace of the given node. Differs from simply getting
the node's prefix and using getNamespaceForPrefix in that it attempts
to cache some of the data in NSINFO objects, to avoid repeated lookup.
TODO: Should we consider moving that logic into getNamespaceForPrefix?<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - Node to be examined.<DT><B>Returns:</B><DD>String containing the Namespace Name (uri) for this node.
Note that this is undefined for any nodes other than Elements and
Attributes.</DL>
</DD>
</DL>
<HR>
<A NAME="getLocalNameOfNode(org.w3c.dom.Node)"><!-- --></A><H3>
getLocalNameOfNode</H3>
<PRE>
public java.lang.String <B>getLocalNameOfNode</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</PRE>
<DL>
<DD>Returns the local name of the given node. If the node's name begins
with a namespace prefix, this is the part after the colon; otherwise
it's the full node name.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - the node to be examined.<DT><B>Returns:</B><DD>String containing the Local Name</DL>
</DD>
</DL>
<HR>
<A NAME="getExpandedElementName(org.w3c.dom.Element)"><!-- --></A><H3>
getExpandedElementName</H3>
<PRE>
public java.lang.String <B>getExpandedElementName</B>(<A HREF="../../../org/w3c/dom/Element.html">Element</A> elem)</PRE>
<DL>
<DD>Returns the element name with the namespace prefix (if any) replaced
by the Namespace URI it was bound to. This is not a standard
representation of a node name, but it allows convenient
single-string comparison of the "universal" names of two nodes.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>elem</CODE> - Element to be examined.<DT><B>Returns:</B><DD>String in the form "namespaceURI:localname" if the node
belongs to a namespace, or simply "localname" if it doesn't.<DT><B>See Also: </B><DD><A HREF="../../../org/apache/xpath/DOMHelper.html#getExpandedAttributeName(org.w3c.dom.Attr)"><CODE>getExpandedAttributeName(org.w3c.dom.Attr)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getExpandedAttributeName(org.w3c.dom.Attr)"><!-- --></A><H3>
getExpandedAttributeName</H3>
<PRE>
public java.lang.String <B>getExpandedAttributeName</B>(<A HREF="../../../org/w3c/dom/Attr.html">Attr</A> attr)</PRE>
<DL>
<DD>Returns the attribute name with the namespace prefix (if any) replaced
by the Namespace URI it was bound to. This is not a standard
representation of a node name, but it allows convenient
single-string comparison of the "universal" names of two nodes.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>attr</CODE> - Attr to be examined<DT><B>Returns:</B><DD>String in the form "namespaceURI:localname" if the node
belongs to a namespace, or simply "localname" if it doesn't.<DT><B>See Also: </B><DD><A HREF="../../../org/apache/xpath/DOMHelper.html#getExpandedElementName(org.w3c.dom.Element)"><CODE>getExpandedElementName(org.w3c.dom.Element)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="isIgnorableWhitespace(org.w3c.dom.Text)"><!-- --></A><H3>
isIgnorableWhitespace</H3>
<PRE>
public boolean <B>isIgnorableWhitespace</B>(<A HREF="../../../org/w3c/dom/Text.html">Text</A> node)</PRE>
<DL>
<DD><B>Deprecated.</B> <I></I> <DD>Tell if the node is ignorable whitespace. Note that this can
be determined only in the context of a DTD or other Schema,
and that DOM Level 2 has nostandardized DOM API which can
return that information.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - Node to be examined<DT><B>Returns:</B><DD>CURRENTLY HARDCODED TO FALSE, but should return true if
and only if the node is of type Text, contains only whitespace,
and does not appear as part of the #PCDATA content of an element.
(Note that determining this last may require allowing for
Entity References.)</DL>
</DD>
</DL>
<HR>
<A NAME="getRoot(org.w3c.dom.Node)"><!-- --></A><H3>
getRoot</H3>
<PRE>
public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>getRoot</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)</PRE>
<DL>
<DD><B>Deprecated.</B> <I></I> <DD>Get the first unparented node in the ancestor chain.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - Starting node, to specify which chain to chase<DT><B>Returns:</B><DD>the topmost ancestor.</DL>
</DD>
</DL>
<HR>
<A NAME="getRootNode(org.w3c.dom.Node)"><!-- --></A><H3>
getRootNode</H3>
<PRE>
public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>getRootNode</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</PRE>
<DL>
<DD>Get the root node of the document tree, regardless of
whether or not the node passed in is a document node.
<p>
TODO: This doesn't handle DocumentFragments or "orphaned" subtrees
-- it's currently returning ownerDocument even when the tree is
not actually part of the main Document tree. We should either
rewrite the description to say that it finds the Document node,
or change the code to walk up the ancestor chain.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - Node to be examined<DT><B>Returns:</B><DD>the Document node. Note that this is not the correct answer
if n was (or was a child of) a DocumentFragment or an orphaned node,
as can arise if the DOM has been edited rather than being generated
by a parser.</DL>
</DD>
</DL>
<HR>
<A NAME="isNamespaceNode(org.w3c.dom.Node)"><!-- --></A><H3>
isNamespaceNode</H3>
<PRE>
public boolean <B>isNamespaceNode</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> n)</PRE>
<DL>
<DD>Test whether the given node is a namespace decl node. In DOM Level 2
this can be done in a namespace-aware manner, but in Level 1 DOMs
it has to be done by testing the node name.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - Node to be examined.<DT><B>Returns:</B><DD>boolean -- true iff the node is an Attr whose name is
"xmlns" or has the "xmlns:" prefix.</DL>
</DD>
</DL>
<HR>
<A NAME="getParentOfNode(org.w3c.dom.Node)"><!-- --></A><H3>
getParentOfNode</H3>
<PRE>
public <A HREF="../../../org/w3c/dom/Node.html">Node</A> <B>getParentOfNode</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)
throws java.lang.RuntimeException</PRE>
<DL>
<DD>Obtain the XPath-model parent of a DOM node -- ownerElement for Attrs,
parent for other nodes.
<p>
Background: The DOM believes that you must be your Parent's
Child, and thus Attrs don't have parents. XPath said that Attrs
do have their owning Element as their parent. This function
bridges the difference, either by using the DOM Level 2 ownerElement
function or by using a "silly and expensive function" in Level 1
DOMs.
<p>
(There's some discussion of future DOMs generalizing ownerElement
into ownerNode and making it work on all types of nodes. This
still wouldn't help the users of Level 1 or Level 2 DOMs)
<p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - Node whose XPath parent we want to obtain<DT><B>Returns:</B><DD>the parent of the node, or the ownerElement if it's an
Attr node, or null if the node is an orphan.<DT><B>Throws:</B><DD>java.lang.RuntimeException - if the Document has no root element.
This can't arise if the Document was created
via the DOM Level 2 factory methods, but is possible if other
mechanisms were used to obtain it</DL>
</DD>
</DL>
<HR>
<A NAME="getElementByID(java.lang.String, org.w3c.dom.Document)"><!-- --></A><H3>
getElementByID</H3>
<PRE>
public <A HREF="../../../org/w3c/dom/Element.html">Element</A> <B>getElementByID</B>(java.lang.String id,
<A HREF="../../../org/w3c/dom/Document.html">Document</A> doc)</PRE>
<DL>
<DD>Given an ID, return the element. This can work only if the document
is interpreted in the context of a DTD or Schema, since otherwise
we don't know which attributes are or aren't IDs.
<p>
Note that DOM Level 1 had no ability to retrieve this information.
DOM Level 2 introduced it but does not promise that it will be
supported in all DOMs; those which can't support it will always
return null.
<p>
TODO: getElementByID is currently unimplemented. Support DOM Level 2?<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The unique identifier to be searched for.<DD><CODE>doc</CODE> - The document to search within.<DT><B>Returns:</B><DD>CURRENTLY HARDCODED TO NULL, but it should be:
The node which has this unique identifier, or null if there
is no such node or this DOM can't reliably recognize it.</DL>
</DD>
</DL>
<HR>
<A NAME="getUnparsedEntityURI(java.lang.String, org.w3c.dom.Document)"><!-- --></A><H3>
getUnparsedEntityURI</H3>
<PRE>
public java.lang.String <B>getUnparsedEntityURI</B>(java.lang.String name,
<A HREF="../../../org/w3c/dom/Document.html">Document</A> doc)</PRE>
<DL>
<DD>The getUnparsedEntityURI function returns the URI of the unparsed
entity with the specified name in the same document as the context
node (see [3.3 Unparsed Entities]). It returns the empty string if
there is no such entity.
<p>
XML processors may choose to use the System Identifier (if one
is provided) to resolve the entity, rather than the URI in the
Public Identifier. The details are dependent on the processor, and
we would have to support some form of plug-in resolver to handle
this properly. Currently, we simply return the System Identifier if
present, and hope that it a usable URI or that our caller can
map it to one.
TODO: Resolve Public Identifiers... or consider changing function name.
<p>
If we find a relative URI
reference, XML expects it to be resolved in terms of the base URI
of the document. The DOM doesn't do that for us, and it isn't
entirely clear whether that should be done here; currently that's
pushed up to a higher levelof our application. (Note that DOM Level
1 didn't store the document's base URI.)
TODO: Consider resolving Relative URIs.
<p>
(The DOM's statement that "An XML processor may choose to
completely expand entities before the structure model is passed
to the DOM" refers only to parsed entities, not unparsed, and hence
doesn't affect this function.)<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - A string containing the Entity Name of the unparsed
entity.<DD><CODE>doc</CODE> - Document node for the document to be searched.<DT><B>Returns:</B><DD>String containing the URI of the Unparsed Entity, or an
empty string if no such entity exists.</DL>
</DD>
</DL>
<HR>
<A NAME="setDOMFactory(org.w3c.dom.Document)"><!-- --></A><H3>
setDOMFactory</H3>
<PRE>
public void <B>setDOMFactory</B>(<A HREF="../../../org/w3c/dom/Document.html">Document</A> domFactory)</PRE>
<DL>
<DD>Store the factory object required to create DOM nodes
in the result tree. In fact, that's just the result tree's
Document node...<DD><DL>
<DT><B>Parameters:</B><DD><CODE>domFactory</CODE> - The DOM Document Node within whose context
the result tree will be built.</DL>
</DD>
</DL>
<HR>
<A NAME="getDOMFactory()"><!-- --></A><H3>
getDOMFactory</H3>
<PRE>
public <A HREF="../../../org/w3c/dom/Document.html">Document</A> <B>getDOMFactory</B>()</PRE>
<DL>
<DD>Retrieve the factory object required to create DOM nodes
in the result tree.<DD><DL>
<DT><B>Returns:</B><DD>The result tree's DOM Document Node.</DL>
</DD>
</DL>
<HR>
<A NAME="getNodeData(org.w3c.dom.Node)"><!-- --></A><H3>
getNodeData</H3>
<PRE>
public static java.lang.String <B>getNodeData</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node)</PRE>
<DL>
<DD>Get the textual contents of the node. See
getNodeData(Node,FastStringBuffer) for discussion of how
whitespace nodes are handled.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - DOM Node to be examined<DT><B>Returns:</B><DD>String containing a concatenation of all the
textual content within that node.<DT><B>See Also: </B><DD><A HREF="../../../org/apache/xpath/DOMHelper.html#getNodeData(org.w3c.dom.Node, org.apache.xml.utils.FastStringBuffer)"><CODE>getNodeData(Node,FastStringBuffer)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getNodeData(org.w3c.dom.Node, org.apache.xml.utils.FastStringBuffer)"><!-- --></A><H3>
getNodeData</H3>
<PRE>
public static void <B>getNodeData</B>(<A HREF="../../../org/w3c/dom/Node.html">Node</A> node,
<A HREF="../../../org/apache/xml/utils/FastStringBuffer.html">FastStringBuffer</A> buf)</PRE>
<DL>
<DD>Retrieve the text content of a DOM subtree, appending it into a
user-supplied FastStringBuffer object. Note that attributes are
not considered part of the content of an element.
<p>
There are open questions regarding whitespace stripping.
Currently we make no special effort in that regard, since the standard
DOM doesn't yet provide DTD-based information to distinguish
whitespace-in-element-context from genuine #PCDATA. Note that we
should probably also consider xml:space if/when we address this.
DOM Level 3 may solve the problem for us.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - Node whose subtree is to be walked, gathering the
contents of all Text or CDATASection nodes.<DD><CODE>buf</CODE> - FastStringBuffer into which the contents of the text
nodes are to be concatenated.</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=2 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 ID="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DOMHelper.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/apache/xpath/DOM2Helper.html"><B>PREV CLASS</B></A>
<A HREF="../../../org/apache/xpath/Expression.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>
<A HREF="DOMHelper.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
Copyright 2000 Apache XML Project. All Rights Reserved.
</BODY>
</HTML>
|