public XMLSerializer endTag ( String namespace , String name ) throws IOException { // check that level is valid //// assert namespace != null; // if(namespace != null) { // namespace = namespace.intern(); // } seenBracket = seenBracketBracket = false ; if ( namespace != null ) { if ( ! namesInterned ) { namespace = namespace . intern ( ) ; } else if ( checkNamesInterned ) { checkInterning ( namespace ) ; } } if ( namespace != elNamespace [ depth ] ) { throw new IllegalArgumentException ( "expected namespace " + printable ( elNamespace [ depth ] ) + " and not " + printable ( namespace ) + getLocation ( ) ) ; } if ( name == null ) { throw new IllegalArgumentException ( "end tag name can not be null" + getLocation ( ) ) ; } if ( checkNamesInterned && namesInterned ) { checkInterning ( name ) ; } String startTagName = elName [ depth ] ; if ( ( ! name . equals ( startTagName ) ) ) { throw new IllegalArgumentException ( "expected element name " + printable ( elName [ depth ] ) + " and not " + printable ( name ) + getLocation ( ) ) ; } if ( startTagIncomplete ) { writeNamespaceDeclarations ( ) ; // out.write(" />"); //space is added to make it easier to work in // XHTML!!! out . write ( "/>" ) ; -- depth ; } else { // assert startTagIncomplete == false; if ( doIndent && seenTag ) { writeIndent ( ) ; } out . write ( "</" ) ; String startTagPrefix = elPrefix [ depth ] ; if ( startTagPrefix . length ( ) > 0 ) { out . write ( startTagPrefix ) ; out . write ( ' ' ) ; } // if(namespace != null && namespace.length() > 0) { // //TODO prefix should be alredy known from matching start tag ... // final String prefix = lookupOrDeclarePrefix( namespace ); // //assert( prefix != null); // if(prefix.length() > 0) { // out.write(prefix); // out.write(':'); // } // } out . write ( name ) ; out . write ( ' ' ) ; -- depth ; } namespaceEnd = elNamespaceCount [ depth ] ; startTagIncomplete = false ; seenTag = true ; return this ; }
End tag .