private void insertUsedContextPrefixes(){
  int unknownPrefixesCount=unknownPrefixesInXMLLiteral.size();
  if (unknownPrefixesCount > 0) {
    StringBuilder contextPrefixes=new StringBuilder(1024);
    ElementInfo topElement=peekStack();
    for (int i=0; i < unknownPrefixesCount; i++) {
      String prefix=unknownPrefixesInXMLLiteral.get(i);
      String namespace=topElement.getNamespace(prefix);
      if (namespace != null) {
        appendNamespaceDecl(contextPrefixes,prefix,namespace);
      }
    }
    int endOfFirstStartTag=charBuf.indexOf(">");
    charBuf.insert(endOfFirstStartTag,contextPrefixes.toString());
  }
  unknownPrefixesInXMLLiteral.clear();
}

private void insertUsedContextPrefixes ( ) { int unknownPrefixesCount = unknownPrefixesInXMLLiteral . size ( ) ; if ( unknownPrefixesCount > 0 ) { StringBuilder contextPrefixes = new StringBuilder ( 1024 ) ; ElementInfo topElement = peekStack ( ) ; for ( int i = 0 ; i < unknownPrefixesCount ; i ++ ) { String prefix = unknownPrefixesInXMLLiteral . get ( i ) ; String namespace = topElement . getNamespace ( prefix ) ; if ( namespace != null ) { appendNamespaceDecl ( contextPrefixes , prefix , namespace ) ; } } int endOfFirstStartTag = charBuf . indexOf ( ">" ) ; charBuf . insert ( endOfFirstStartTag , contextPrefixes . toString ( ) ) ; } unknownPrefixesInXMLLiteral . clear ( ) ; }
inserts prefix mappings from an xml literal ' s context for all prefixes that are used in the xml literal and that are not defined in the xml literal itself .
