<HTML><HEAD><TITLE>Xalan-C++ API Documentation</TITLE></HEAD> <BODY> <h2 align="center">Xalan-C++ API Documentation</h2> <h3 align="center">The Xalan C++ XSLT Processor Version 1.4</h3> </BODY> <!-- Generated by Doxygen 1.1.2 on Mon Sep 16 08:25:53 2002 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> <hr><h1>StylesheetHandler.hpp</h1><a href="StylesheetHandler.hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 /* 00002 * The Apache Software License, Version 1.1 00003 * 00004 * 00005 * Copyright (c) 1999-2002 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 * $ Id: $ 00058 * 00059 */ 00060 00061 #if !defined(XALAN_STYLESHEETHANDLER_HEADER_GUARD) <a name="l00062"><a class="code" href="StylesheetHandler.hpp.html#a0">00062</a></a> #define XALAN_STYLESHEETHANDLER_HEADER_GUARD 00063 00064 // Base include file. Must be first. 00065 #include "XSLTDefinitions.hpp" 00066 00067 00068 00069 #include <vector> 00070 #include <set> 00071 00072 00073 00074 #include <XalanDOM/XalanDOMString.hpp> 00075 00076 00077 00078 #include <PlatformSupport/FormatterListener.hpp> 00079 00080 00081 00082 #include <XPath/XalanQNameByValue.hpp> 00083 00084 00085 00086 #include <XSLT/NamespacesHandler.hpp> 00087 #include <XSLT/Stylesheet.hpp> 00088 00089 00090 00091 class <a class="code" href="class_elemtemplate.html">ElemTemplate</a>; 00092 class <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>; 00093 class <a class="code" href="class_elemtextliteral.html">ElemTextLiteral</a>; 00094 class <a class="code" href="class_extensionnshandler.html">ExtensionNSHandler</a>; 00095 class <a class="code" href="class_stylesheetconstructioncontext.html">StylesheetConstructionContext</a>; 00096 00097 00098 <a name="l00105"><a class="code" href="class_stylesheethandler.html">00105</a></a> class XALAN_XSLT_EXPORT <a class="code" href="class_stylesheethandler.html">StylesheetHandler</a> : public <a class="code" href="class_formatterlistener.html">FormatterListener</a> 00106 { 00107 00108 public: 00109 00110 #if defined(XALAN_NO_NAMESPACES) 00111 typedef vector<<a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>*> ElemTemplateStackType; 00112 typedef vector<<a class="code" href="class_elemtextliteral.html">ElemTextLiteral</a>*> ElemTextLiteralStackType; 00113 typedef set<<a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>*, 00114 less<<a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>*> > ElemTemplateSetType; 00115 typedef vector<bool> BoolStackType; 00116 typedef set<<a class="code" href="class_xalanqnamebyvalue.html">XalanQNameByValue</a>, 00117 less<<a class="code" href="class_xalanqnamebyvalue.html">XalanQNameByValue</a>> > QNameSetType; 00118 typedef vector<QNameSetType> QNameSetVectorType; 00119 #else <a name="l00120"><a class="code" href="class_stylesheethandler.html#s0">00120</a></a> typedef std::vector<<a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>*> ElemTemplateStackType; <a name="l00121"><a class="code" href="class_stylesheethandler.html#s1">00121</a></a> typedef std::vector<<a class="code" href="class_elemtextliteral.html">ElemTextLiteral</a>*> ElemTextLiteralStackType; <a name="l00122"><a class="code" href="class_stylesheethandler.html#s2">00122</a></a> typedef std::set<<a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>*> ElemTemplateSetType; <a name="l00123"><a class="code" href="class_stylesheethandler.html#s3">00123</a></a> typedef std::vector<bool> BoolStackType; <a name="l00124"><a class="code" href="class_stylesheethandler.html#s4">00124</a></a> typedef std::set<<a class="code" href="class_xalanqnamebyvalue.html">XalanQNameByValue</a>> QNameSetType; <a name="l00125"><a class="code" href="class_stylesheethandler.html#s5">00125</a></a> typedef std::vector<QNameSetType> QNameSetVectorType; 00126 #endif 00127 00131 static void 00132 <a class="code" href="class_stylesheethandler.html#d0">initialize</a>(); 00133 00137 static void 00138 <a class="code" href="class_stylesheethandler.html#d1">terminate</a>(); 00139 00144 <a class="code" href="class_stylesheethandler.html#a0">StylesheetHandler</a>( 00145 <a class="code" href="class_stylesheet.html">Stylesheet</a>& stylesheetTree, 00146 <a class="code" href="class_stylesheetconstructioncontext.html">StylesheetConstructionContext</a>& constructionContext); 00147 00148 virtual 00149 <a class="code" href="class_stylesheethandler.html#a1">~StylesheetHandler</a>(); 00150 00174 virtual void <a class="code" href="class_formatterlistener.html#a9">characters</a> (const XMLCh* const chars, const unsigned int length); 00175 00186 virtual void <a class="code" href="class_formatterlistener.html#a5">charactersRaw</a>(const XMLCh* const chars, const unsigned int length); 00187 00211 virtual void <a class="code" href="class_formatterlistener.html#a7">cdata</a>(const XMLCh* const ch, const unsigned int length); 00212 00236 virtual void <a class="code" href="class_formatterlistener.html#a12">ignorableWhitespace</a> (const XMLCh* const chars, const unsigned int length); 00237 00254 virtual void <a class="code" href="class_formatterlistener.html#a13">processingInstruction</a> (const XMLCh* const target, const XMLCh* const data); 00255 00262 virtual void <a class="code" href="class_formatterlistener.html#a6">comment</a>(const XMLCh* const data); 00263 00270 virtual void <a class="code" href="class_formatterlistener.html#a8">entityReference</a>(const XMLCh* const data); 00271 00272 // These methods are inherited DocumentHandler ... 00273 00274 // $$$ Theoretically, shouldn't need javadoc for these, since they are 00275 // inherited from DocumentHandler, but let's leave them in for now -- JMD 00276 00302 virtual void <a class="code" href="class_formatterlistener.html#a15">setDocumentLocator</a>(const <a class="code" href="class_locator.html">Locator</a>* const locator); 00303 00313 virtual void <a class="code" href="class_formatterlistener.html#a16">startDocument</a>(); 00314 00326 virtual void <a class="code" href="class_formatterlistener.html#a10">endDocument</a> (); 00327 00349 virtual void <a class="code" href="class_formatterlistener.html#a17">startElement</a> (const XMLCh* const name, <a class="code" href="class_attributelist.html">AttributeList</a>& attrs); 00350 00365 virtual void <a class="code" href="class_formatterlistener.html#a11">endElement</a>(const XMLCh* const name); 00366 00372 virtual void <a class="code" href="class_formatterlistener.html#a14">resetDocument</a>(); 00373 00374 protected: 00375 00385 bool 00386 <a class="code" href="class_stylesheethandler.html#b0">isAttrOK</a>( 00387 const XalanDOMChar* attrName, 00388 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00389 int which); 00390 00401 bool 00402 <a class="code" href="class_stylesheethandler.html#b1">processSpaceAttr</a>( 00403 const XalanDOMChar* aname, 00404 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00405 int which, 00406 const <a class="code" href="class_locator.html">Locator</a>* locator, 00407 bool& fPreserve); 00408 00417 bool 00418 <a class="code" href="class_stylesheethandler.html#b1">processSpaceAttr</a>( 00419 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00420 const <a class="code" href="class_locator.html">Locator</a>* locator, 00421 bool& fPreserve); 00422 00426 void 00427 <a class="code" href="class_stylesheethandler.html#b3">processImport</a>( 00428 const XalanDOMChar* name, 00429 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00430 const <a class="code" href="class_locator.html">Locator</a>* locator); 00431 00435 void 00436 <a class="code" href="class_stylesheethandler.html#b4">processInclude</a>( 00437 const XalanDOMChar* name, 00438 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00439 const <a class="code" href="class_locator.html">Locator</a>* locator); 00440 00441 void 00442 <a class="code" href="class_stylesheethandler.html#b5">doCleanup</a>(); 00443 00444 private: 00445 00446 // not implemented 00447 <a class="code" href="class_stylesheethandler.html#a0">StylesheetHandler</a>(const <a class="code" href="class_stylesheethandler.html">StylesheetHandler</a>&); 00448 00449 <a class="code" href="class_stylesheethandler.html">StylesheetHandler</a>& 00450 operator=(const <a class="code" href="class_stylesheethandler.html">StylesheetHandler</a>&); 00451 00452 // Utility functions... 00453 void 00454 error( 00455 const char* theMessage, 00456 const <a class="code" href="class_locator.html">Locator</a>* theLocator) const; 00457 00458 void 00459 error( 00460 const <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& theMessage, 00461 const <a class="code" href="class_locator.html">Locator</a>* theLocator) const; 00462 00463 void 00464 processText( 00465 const XMLCh* chars, 00466 XalanDOMString::size_type length); 00467 00468 void 00469 accumulateText( 00470 const XMLCh* chars, 00471 XalanDOMString::size_type length); 00472 00473 void 00474 processAccumulatedText(); 00475 00476 void 00477 processTopLevelElement( 00478 const XalanDOMChar* name, 00479 const <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& localName, 00480 const <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& ns, 00481 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00482 int xslToken, 00483 const <a class="code" href="class_locator.html">Locator</a>* locator, 00484 bool& fPreserveSpace, 00485 bool& fSpaceAttrProcessed); 00486 00487 void 00488 processStylesheet( 00489 const XalanDOMChar* name, 00490 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00491 const <a class="code" href="class_locator.html">Locator</a>* locator, 00492 bool& fPreserveSpace, 00493 bool& fSpaceAttrProcessed); 00494 00495 void 00496 processPreserveStripSpace( 00497 const XalanDOMChar* name, 00498 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00499 const <a class="code" href="class_locator.html">Locator</a>* locator, 00500 int xslToken); 00501 00502 void 00503 appendChildElementToParent( 00504 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* elem, 00505 const <a class="code" href="class_locator.html">Locator</a>* locator); 00506 00507 void 00508 appendChildElementToParent( 00509 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* parent, 00510 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* elem); 00511 00512 void 00513 appendChildElementToParent( 00514 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* parent, 00515 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* elem, 00516 const <a class="code" href="class_locator.html">Locator</a>* locator); 00517 00518 bool 00519 inExtensionElement() const; 00520 00521 void 00522 processExtensionElement( 00523 const XalanDOMChar* name, 00524 const <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& localName, 00525 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00526 const <a class="code" href="class_locator.html">Locator</a>* locator); 00527 00528 void 00529 checkForOrAddVariableName( 00530 const <a class="code" href="class_xalanqname.html">XalanQName</a>& theVariableName, 00531 const <a class="code" href="class_locator.html">Locator</a>* theLocator); 00532 00533 // Data members... 00534 00538 <a class="code" href="class_stylesheet.html">Stylesheet</a>& m_stylesheet; 00539 00543 <a class="code" href="class_stylesheetconstructioncontext.html">StylesheetConstructionContext</a>& m_constructionContext; 00544 00548 ElemTemplateStackType m_elemStack; 00549 00555 ElemTemplateSetType m_elemStackParentedElements; 00556 00560 ElemTemplateStackType m_strayElements; 00561 00567 ElemTextLiteralStackType m_whiteSpaceElems; 00568 00572 <a class="code" href="class_elemtemplate.html">ElemTemplate</a>* m_pTemplate; 00573 00578 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* m_lastPopped; 00579 00583 bool m_inTemplate; 00584 00589 bool m_foundStylesheet; 00590 00596 bool m_foundNotImport; 00597 00602 <a class="code" href="class_xalandomstring.html">XalanDOMString</a> m_accumulateText; 00603 00604 <a class="code" href="class_xalandomstring.html">XalanDOMString</a> m_includeBase; 00605 00606 BoolStackType m_inExtensionElementStack; 00607 00608 BoolStackType m_preserveSpaceStack; 00609 00610 bool m_inLXSLTScript; 00611 00612 <a class="code" href="class_xalandomstring.html">XalanDOMString</a> m_LXSLTScriptBody; 00613 <a class="code" href="class_xalandomstring.html">XalanDOMString</a> m_LXSLTScriptLang; 00614 <a class="code" href="class_xalandomstring.html">XalanDOMString</a> m_LXSLTScriptSrcURL; 00615 <a class="code" href="class_extensionnshandler.html">ExtensionNSHandler</a>* m_pLXSLTExtensionNSH; 00616 00617 // Note that these variables must not be saved by 00618 // PushPopIncludeState... 00619 unsigned long m_locatorsPushed; 00620 00621 QNameSetType m_globalVariableNames; 00622 00623 enum { eVariablesStackDefault = 20 }; 00624 00625 QNameSetVectorType m_inScopeVariableNamesStack; 00626 00630 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* 00631 initWrapperless( 00632 const XalanDOMChar* name, 00633 const <a class="code" href="class_attributelist.html">AttributeList</a>& atts, 00634 int lineNumber, 00635 int columnNumber); 00636 00637 const <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& 00638 getNamespaceFromStack(const XalanDOMChar* theName) const; 00639 00640 const <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& 00641 getNamespaceForPrefixFromStack(const <a class="code" href="class_xalandomstring.html">XalanDOMString</a>& thePrefix) const; 00642 00643 class PushPopIncludeState 00644 { 00645 public: 00646 00647 PushPopIncludeState(<a class="code" href="class_stylesheethandler.html">StylesheetHandler</a>& theHandler); 00648 00649 ~PushPopIncludeState(); 00650 00651 private: 00652 00653 <a class="code" href="class_stylesheethandler.html">StylesheetHandler</a>& m_handler; 00654 00655 ElemTemplateStackType m_elemStack; 00656 00657 ElemTemplateSetType m_elemStackParentedElements; 00658 00659 <a class="code" href="class_elemtemplate.html">ElemTemplate</a>* const m_pTemplate; 00660 00661 <a class="code" href="class_elemtemplateelement.html">ElemTemplateElement</a>* const m_lastPopped; 00662 00663 const bool m_inTemplate; 00664 00665 const bool m_foundStylesheet; 00666 00667 const <a class="code" href="class_xalandomstring.html">XalanDOMString</a> m_XSLNameSpaceURL; 00668 00669 const bool m_foundNotImport; 00670 00671 Stylesheet::NamespaceVectorType m_namespaceDecls; 00672 00673 Stylesheet::NamespacesStackType m_namespaces; 00674 00675 <a class="code" href="class_namespaceshandler.html">NamespacesHandler</a> m_namespacesHandler; 00676 00677 BoolStackType m_inExtensionElementStack; 00678 00679 BoolStackType m_preserveSpaceStack; 00680 }; 00681 <a name="l00682"><a class="code" href="class_stylesheethandler.html#l0">00682</a></a> friend class PushPopIncludeState; 00683 00684 static const <a class="code" href="class_xalandomstring.html">XalanDOMString</a> s_emptyString; 00685 00686 static const <a class="code" href="class_xalanqname.html">XalanQName</a>& s_spaceAttrQName; 00687 }; 00688 00689 00690 00691 #endif // XALAN_STYLESHEETHANDLER_HEADER_GUARD </div></pre><p align="center"><a href="diagramnotes.html">Interpreting class diagrams</a></p> <p><FONT color="#000000" face="arial,helvetica,sanserif" size="-1"> <i><A href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</A> and <A href="http://www.research.att.com/sw/tools/graphviz/">GraphViz</A> are used to generate this API documentation from the Xalan-C header files.</I></FONT></p> <TABLE border="0" cellpadding="0" cellspacing="0" width="820"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1"></TD></TR></TABLE> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="80%"> <TR> <TD WIDTH="80%" VALIGN="TOP"> <P ALIGN="CENTER"><B>Xalan-C++ XSLT Processor Version 1.4</B><BR> Copyright © 2000, 2001, 2002 The Apache Software Foundation. All Rights Reserved.</i></p> </TD> </TR> <TR> <TD WIDTH="100%"> <P ALIGN="CENTER"><IMG SRC="ApacheLogo.jpg" WIDTH="387" HEIGHT="100" ALIGN="BOTTOM" BORDER="0"> </TD> </TR> </TABLE>