private Node createPseudoElement ( ElementBox box , PseudoElementType pseudo ) { Element n = box . getElement ( ) ; //New box style NodeData style = decoder . getElementStyleInherited ( n , pseudo ) ; if ( style != null ) { TermList cont = style . getValue ( TermList . class , "content" ) ; if ( cont != null && cont . size ( ) > 0 ) { //create the DOM tree for the pseudo element //parent Element pelem = createAnonymousElement ( n . getOwnerDocument ( ) , "XPspan" , "inline" ) ; //content elements for ( Term < ? > c : cont ) { if ( c instanceof TermIdent ) { } else if ( c instanceof TermString ) { Text txt = n . getOwnerDocument ( ) . createTextNode ( ( ( TermString ) c ) . getValue ( ) ) ; pelem . appendChild ( txt ) ; } else if ( c instanceof TermURI ) { } else if ( c instanceof TermFunction . Attr ) { TermFunction . Attr f = ( TermFunction . Attr ) c ; String val = HTMLNorm . getAttribute ( n , f . getName ( ) ) ; Text txt = n . getOwnerDocument ( ) . createTextNode ( val ) ; pelem . appendChild ( txt ) ; } } //use the pseudo element style for the new (main) element decoder . useStyle ( pelem , null , style ) ; return pelem ; } else return null ; //no contents } else return null ; //no pseudo declaration }
Creates a new box for a pseudo - element .