00001 /* 00002 * The Apache Software License, Version 1.1 00003 * 00004 * 00005 * Copyright (c) 1999-2000 The Apache Software Foundation. All rights 00006 * reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in 00017 * the documentation and/or other materials provided with the 00018 * distribution. 00019 * 00020 * 3. The end-user documentation included with the redistribution, 00021 * if any, must include the following acknowledgment: 00022 * "This product includes software developed by the 00023 * Apache Software Foundation (http://www.apache.org/)." 00024 * Alternately, this acknowledgment may appear in the software itself, 00025 * if and wherever such third-party acknowledgments normally appear. 00026 * 00027 * 4. The names "Xalan" and "Apache Software Foundation" must 00028 * not be used to endorse or promote products derived from this 00029 * software without prior written permission. For written 00030 * permission, please contact apache@apache.org. 00031 * 00032 * 5. Products derived from this software may not be called "Apache", 00033 * nor may "Apache" appear in their name, without prior written 00034 * permission of the Apache Software Foundation. 00035 * 00036 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00037 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00038 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00039 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00040 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00041 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00042 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00043 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00045 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00046 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00047 * SUCH DAMAGE. 00048 * ==================================================================== 00049 * 00050 * This software consists of voluntary contributions made by many 00051 * individuals on behalf of the Apache Software Foundation and was 00052 * originally based on software copyright (c) 1999, International 00053 * Business Machines, Inc., http://www.ibm.com. For more 00054 * information on the Apache Software Foundation, please see 00055 * <http://www.apache.org/>. 00056 */ 00057 #if !defined(XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680) 00058 #define XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680 00059 00060 00061 00062 #include <XalanSourceTree/XalanSourceTreeDefinitions.hpp> 00063 00064 00065 00066 #include <XalanDOM/XalanDOMString.hpp> 00067 #include <XalanDOM/XalanElement.hpp> 00068 #include <XalanDOM/XalanNamedNodeMap.hpp> 00069 00070 00071 00072 class XalanSourceTreeAttr; 00073 class XalanSourceTreeComment; 00074 class XalanSourceTreeDocument; 00075 class XalanSourceTreeDocumentFragment; 00076 class XalanSourceTreeProcessingInstruction; 00077 class XalanSourceTreeText; 00078 00079 00080 00081 class XALAN_XALANSOURCETREE_EXPORT XalanSourceTreeElement : public XalanElement, private XalanNamedNodeMap 00082 { 00083 public: 00084 00085 typedef unsigned long AttributesCountType; 00086 00099 XalanSourceTreeElement( 00100 const XalanDOMString& theTagName, 00101 XalanSourceTreeDocument* theOwnerDocument, 00102 XalanSourceTreeAttr** theAttributes, 00103 AttributesCountType theAttributeCount, 00104 XalanNode* theParentNode = 0, 00105 XalanNode* thePreviousSibling = 0, 00106 XalanNode* theNextSibling = 0, 00107 unsigned int theIndex = 0); 00108 00109 virtual 00110 ~XalanSourceTreeElement(); 00111 00112 00116 virtual const XalanDOMString& 00117 getNodeName() const; 00118 00122 virtual const XalanDOMString& 00123 getNodeValue() const; 00124 00128 virtual NodeType 00129 getNodeType() const; 00130 00140 virtual XalanNode* 00141 getParentNode() const; 00142 00156 virtual const XalanNodeList* 00157 getChildNodes() const; 00158 00164 virtual XalanNode* 00165 getFirstChild() const; 00166 00172 virtual XalanNode* 00173 getLastChild() const; 00174 00180 virtual XalanNode* 00181 getPreviousSibling() const; 00182 00188 virtual XalanNode* 00189 getNextSibling() const; 00190 00195 virtual const XalanNamedNodeMap* 00196 getAttributes() const; 00197 00207 virtual XalanDocument* 00208 getOwnerDocument() const; 00209 00210 //@} 00212 //@{ 00213 00232 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) 00233 virtual XalanNode* 00234 #else 00235 virtual XalanSourceTreeElement* 00236 #endif 00237 cloneNode(bool deep) const; 00238 00239 //@} 00241 //@{ 00242 00259 virtual XalanNode* 00260 insertBefore( 00261 XalanNode* newChild, 00262 XalanNode* refChild); 00263 00277 virtual XalanNode* 00278 replaceChild( 00279 XalanNode* newChild, 00280 XalanNode* oldChild); 00281 00289 virtual XalanNode* 00290 removeChild(XalanNode* oldChild); 00291 00303 virtual XalanNode* 00304 appendChild(XalanNode* newChild); 00305 00306 //@} 00308 //@{ 00309 00317 virtual bool 00318 hasChildNodes() const; 00319 00320 00321 //@} 00323 //@{ 00324 00325 00339 virtual void 00340 setNodeValue(const XalanDOMString& nodeValue); 00341 00342 //@} 00344 //@{ 00345 00362 virtual void 00363 normalize(); 00364 00378 virtual bool 00379 isSupported( 00380 const XalanDOMString& feature, 00381 const XalanDOMString& version) const; 00382 00396 virtual const XalanDOMString& 00397 getNamespaceURI() const; 00398 00403 virtual const XalanDOMString& 00404 getPrefix() const; 00405 00413 virtual const XalanDOMString& 00414 getLocalName() const; 00415 00445 virtual void 00446 setPrefix(const XalanDOMString& prefix); 00447 00448 virtual bool 00449 isIndexed() const; 00450 00451 virtual unsigned long 00452 getIndex() const; 00453 00454 //@} 00455 00456 // These interfaces are inherited from XalanElement... 00457 00466 virtual const XalanDOMString& 00467 getTagName() const; 00468 00476 virtual const XalanDOMString& 00477 getAttribute(const XalanDOMString& name) const; 00478 00486 virtual XalanAttr* 00487 getAttributeNode(const XalanDOMString& name) const; 00488 00499 virtual XalanNodeList* 00500 getElementsByTagName(const XalanDOMString& name) const; 00501 00502 //@} 00504 //@{ 00505 00527 virtual void 00528 setAttribute( 00529 const XalanDOMString& name, 00530 const XalanDOMString& value); 00531 00551 virtual XalanAttr* 00552 setAttributeNode(XalanAttr* newAttr); 00553 00554 //@} 00556 //@{ 00557 00573 virtual XalanAttr* 00574 removeAttributeNode(XalanAttr* oldAttr); 00575 00588 virtual void 00589 removeAttribute(const XalanDOMString& name); 00590 00591 //@} 00593 //@{ 00594 00605 virtual const XalanDOMString& 00606 getAttributeNS( 00607 const XalanDOMString& namespaceURI, 00608 const XalanDOMString& localName) const; 00609 00650 virtual void 00651 setAttributeNS( 00652 const XalanDOMString& namespaceURI, 00653 const XalanDOMString& qualifiedName, 00654 const XalanDOMString& value); 00655 00670 virtual void 00671 removeAttributeNS( 00672 const XalanDOMString& namespaceURI, 00673 const XalanDOMString& localName); 00674 00685 virtual XalanAttr* 00686 getAttributeNodeNS( 00687 const XalanDOMString& namespaceURI, 00688 const XalanDOMString& localName) const; 00689 00709 virtual XalanAttr* 00710 setAttributeNodeNS(XalanAttr* newAttr); 00711 00727 virtual XalanNodeList* 00728 getElementsByTagNameNS( 00729 const XalanDOMString& namespaceURI, 00730 const XalanDOMString& localName) const; 00731 00732 //@} 00733 00734 00735 // public interfaces not inherited from XalanElement... 00736 00737 XalanSourceTreeDocument* 00738 getDocument() const 00739 { 00740 return m_ownerDocument; 00741 } 00742 00743 void 00744 setParent(XalanSourceTreeElement* theParent) 00745 { 00746 m_parentNode = theParent; 00747 } 00748 00749 void 00750 setParent(XalanSourceTreeDocumentFragment* theParent); 00751 00752 void 00753 setPreviousSibling(XalanSourceTreeComment* thePreviousSibling); 00754 00755 void 00756 setPreviousSibling(XalanSourceTreeElement* thePreviousSibling); 00757 00758 void 00759 setPreviousSibling(XalanSourceTreeProcessingInstruction* thePreviousSibling); 00760 00761 void 00762 setPreviousSibling(XalanSourceTreeText* thePreviousSibling); 00763 00764 void 00765 appendSiblingNode(XalanSourceTreeComment* theSibling); 00766 00767 void 00768 appendSiblingNode(XalanSourceTreeElement* theSibling); 00769 00770 void 00771 appendSiblingNode(XalanSourceTreeProcessingInstruction* theSibling); 00772 00773 void 00774 appendSiblingNode(XalanSourceTreeText* theSibling); 00775 00776 void 00777 appendChildNode(XalanSourceTreeComment* theChild); 00778 00779 void 00780 appendChildNode(XalanSourceTreeElement* theChild); 00781 00782 void 00783 appendChildNode(XalanSourceTreeProcessingInstruction* theChild); 00784 00785 void 00786 appendChildNode(XalanSourceTreeText* theChild); 00787 00788 void 00789 setIndex(unsigned int theIndex) 00790 { 00791 m_index = theIndex; 00792 } 00793 00794 unsigned int 00795 getAttributeCount() const 00796 { 00797 return m_attributeCount; 00798 } 00799 00800 XalanSourceTreeAttr* 00801 getAttributeByIndex(unsigned int index) const 00802 { 00803 return index < m_attributeCount ? m_attributes[index] : 0; 00804 } 00805 00811 void 00812 clearChildren() 00813 { 00814 m_firstChild = 0; 00815 } 00816 00817 XalanSourceTreeElement* 00818 clone(bool deep) const 00819 { 00820 return new XalanSourceTreeElement(*this, deep); 00821 } 00822 00823 protected: 00824 00825 XalanSourceTreeElement( 00826 const XalanSourceTreeElement& theSource, 00827 bool deep = false); 00828 00829 private: 00830 00831 // These are from XalanNamedNodeMap... 00832 00833 virtual XalanNode* 00834 setNamedItem(XalanNode* arg); 00835 00836 virtual XalanNode* 00837 item(unsigned int index) const; 00838 00839 virtual XalanNode* 00840 getNamedItem(const XalanDOMString& name) const; 00841 00842 virtual unsigned int 00843 getLength() const; 00844 00845 virtual XalanNode* 00846 removeNamedItem(const XalanDOMString& name); 00847 00848 virtual XalanNode* 00849 getNamedItemNS( 00850 const XalanDOMString& namespaceURI, 00851 const XalanDOMString& localName) const; 00852 00853 virtual XalanNode* 00854 setNamedItemNS(XalanNode* arg); 00855 00856 virtual XalanNode* 00857 removeNamedItemNS( 00858 const XalanDOMString& namespaceURI, 00859 const XalanDOMString& localName); 00860 00861 00862 // Not implemented... 00863 XalanSourceTreeElement& 00864 operator=(const XalanSourceTreeElement& theSource); 00865 00866 bool 00867 operator==(const XalanSourceTreeElement& theRHS) const; 00868 00869 00870 // Data members... 00871 const XalanDOMString& m_tagName; 00872 00873 XalanSourceTreeDocument* m_ownerDocument; 00874 00875 XalanNode* m_parentNode; 00876 00877 XalanNode* m_previousSibling; 00878 00879 XalanNode* m_nextSibling; 00880 00881 XalanNode* m_firstChild; 00882 00883 unsigned int m_index; 00884 00885 XalanSourceTreeAttr* const * m_attributes; 00886 00887 const AttributesCountType m_attributeCount; 00888 }; 00889 00890 00891 00892 #endif // !defined(XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680)
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.4 |
|