style = new StyleDeclaration(content.getCSSEngine()); style.setProperty( IStyle.STYLE_DISPLAY, CSSValueConstants.INLINE_VALUE ); style.setProperty( IStyle.STYLE_VERTICAL_ALIGN, CSSValueConstants.TOP_VALUE );
	private void handleElement(Element ele, boolean needEscape, HashMap cssStyles, IContent content, int index)	{		IStyle cssStyle = ( IStyle ) cssStyles.get( ele );		if ( cssStyle != null )		{			if ( "none".equals( cssStyle.getDisplay() ) ) //$NON-NLS-1$			{				//Check if the display mode is none.				return;			}		}				String tagName = ele.getTagName();		if ( tagName.toLowerCase().equals( "a" ) ) //$NON-NLS-1$		{			IContainerContent container = new ContainerContent((ReportContent)content.getReportContent());			container.setParent(content);//FIXME addChild to replace?			handleStyle(ele, cssStyles, container);			ActionContent oldAction = action;			handleAnchor( ele, container );			processNodes( ele, needEscape, cssStyles, container );			this.action = oldAction;		}		else if(tagName.toLowerCase().equals( "img" )) //$NON-NLS-1$		{			outputImg( ele, cssStyles, content);		}		else if ( tagName.toLowerCase().equals( "br" ) ) //$NON-NLS-1$		{						ILabelContent label = new LabelContent((ReportContent)content.getReportContent());			addChild(content, label);			label.setText("\n"); //$NON-NLS-1$			StyleDeclaration inlineStyle = new StyleDeclaration(content.getCSSEngine());			inlineStyle.setProperty( IStyle.STYLE_DISPLAY, CSSValueConstants.INLINE_VALUE );			label.setInlineStyle( inlineStyle );		}		else if (tagName.toLowerCase().equals("li") //$NON-NLS-1$				&& ele.getParentNode().getNodeType() == Node.ELEMENT_NODE)		{			StyleDeclaration style = new StyleDeclaration(content.getCSSEngine());			style.setProperty( IStyle.STYLE_DISPLAY, CSSValueConstants.BLOCK_VALUE );			style.setProperty( IStyle.STYLE_VERTICAL_ALIGN, CSSValueConstants.MIDDLE_VALUE );			IContainerContent container = new ContainerContent((ReportContent)content.getReportContent());			container.setInlineStyle(style);			addChild(content, container);			handleStyle(ele, cssStyles, container);						TextContent text = new TextContent((ReportContent)content.getReportContent());			addChild(container, text);			if(ele.getParentNode().getNodeName().equals("ol")) //$NON-NLS-1$			{				text.setText(new Integer(index).toString()+".  "); //$NON-NLS-1$			}			else if(ele.getParentNode().getNodeName().equals("ul")) //$NON-NLS-1$			{				text.setText("  •  " ); //$NON-NLS-1$			}			style = new StyleDeclaration(content.getCSSEngine());			style.setProperty( IStyle.STYLE_DISPLAY, CSSValueConstants.INLINE_VALUE );			style.setProperty( IStyle.STYLE_VERTICAL_ALIGN, CSSValueConstants.TOP_VALUE );			text.setInlineStyle(style);						IContainerContent childContainer = new ContainerContent((ReportContent)content.getReportContent());			addChild(container, childContainer);			childContainer.setInlineStyle(style);			processNodes( ele, needEscape, cssStyles, childContainer );		}		else if (tagName.toLowerCase().equals("dd") || tagName.toLowerCase().equals("dt")) //$NON-NLS-1$ //$NON-NLS-2$		{			IContainerContent container = new ContainerContent((ReportContent)content.getReportContent());			addChild(content, container);			handleStyle(ele, cssStyles, container);						if (tagName.toLowerCase().equals("dd")) //$NON-NLS-1$			{				StyleDeclaration style = new StyleDeclaration(content.getCSSEngine());				style.setProperty( IStyle.STYLE_DISPLAY, CSSValueConstants.INLINE_VALUE );				style.setProperty( IStyle.STYLE_VERTICAL_ALIGN, CSSValueConstants.TOP_VALUE );				TextContent text = new TextContent((ReportContent) content						.getReportContent());				addChild(content, text);				if (ele.getParentNode().getNodeName().equals("dl")) //$NON-NLS-1$				{					text.setText(""); //$NON-NLS-1$				}				style.setTextIndent("3em"); //$NON-NLS-1$				text.setInlineStyle(style);								IContainerContent childContainer = new ContainerContent((ReportContent)content.getReportContent());				childContainer.setInlineStyle(style);				addChild(container, childContainer);								processNodes( ele, needEscape, cssStyles, container );							}			else			{				processNodes(ele, needEscape, cssStyles, container);			}					}		else 		{			IContainerContent container = new ContainerContent((ReportContent)content.getReportContent());			handleStyle(ele, cssStyles, container);			if(htmlDisplayMode.contains(ele.getTagName()))			{				addChild(content, container);				processNodes( ele, needEscape, cssStyles, container );			}			else			{				if(inlineContainerStack.isEmpty( ))				{					container.setParent( content );				}				else				{					container.setParent( ( IContent) inlineContainerStack.peek( ));				}				inlineContainerStack.push( container );				processNodes( ele, needEscape, cssStyles, content );				inlineContainerStack.pop( );			}					}	}