private void initDefaultRule ( ErrorListener errorListener ) throws TransformerException { // Then manufacture a default m_defaultRule = new ElemTemplate ( ) ; m_defaultRule . setStylesheet ( this ) ; XPath defMatch = new XPath ( "*" , this , this , XPath . MATCH , errorListener ) ; m_defaultRule . setMatch ( defMatch ) ; ElemApplyTemplates childrenElement = new ElemApplyTemplates ( ) ; childrenElement . setIsDefaultTemplate ( true ) ; childrenElement . setSelect ( m_selectDefault ) ; m_defaultRule . appendChild ( childrenElement ) ; m_startRule = m_defaultRule ; // ----------------------------- m_defaultTextRule = new ElemTemplate ( ) ; m_defaultTextRule . setStylesheet ( this ) ; defMatch = new XPath ( "text() | @*" , this , this , XPath . MATCH , errorListener ) ; m_defaultTextRule . setMatch ( defMatch ) ; ElemValueOf elemValueOf = new ElemValueOf ( ) ; m_defaultTextRule . appendChild ( elemValueOf ) ; XPath selectPattern = new XPath ( "." , this , this , XPath . SELECT , errorListener ) ; elemValueOf . setSelect ( selectPattern ) ; //-------------------------------- m_defaultRootRule = new ElemTemplate ( ) ; m_defaultRootRule . setStylesheet ( this ) ; defMatch = new XPath ( "/" , this , this , XPath . MATCH , errorListener ) ; m_defaultRootRule . setMatch ( defMatch ) ; childrenElement = new ElemApplyTemplates ( ) ; childrenElement . setIsDefaultTemplate ( true ) ; m_defaultRootRule . appendChild ( childrenElement ) ; childrenElement . setSelect ( m_selectDefault ) ; }
Create the default rule if needed .