Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.openfuxml.addon.wiki;
 
 import java.io.Writer;
 
import  org.apache.commons.configuration.Configuration;
import  org.slf4j.Logger;
import  org.slf4j.LoggerFactory;
public class OpenFuxmlGenerator
	final static Logger logger = LoggerFactory.getLogger(OpenFuxmlGenerator.class);
	private Configuration config;
	public OpenFuxmlGenerator(Configuration config)
	{
		this.=config;
	}
	{
		String footer = "    </body>\n</html>";
		Object[] objects = new Object[2];
		objects[0] = titleText;
		String header = MessageFormat.format(.objects);
		.debug("Header ist: "+header);
		StringBuffer sb = new StringBuffer();
		sb.append(header);
		sb.append(xhtmlContent);
		sb.append(footer);
		.debug("Parsing: "+sb.length()+" characters");
		InputSource inputSource = new InputSource(new StringReader(sb.toString()));
		SAXParserFactory factory = SAXParserFactory.newInstance();
			factory.setNamespaceAware(true);
			factory.setValidating(false);
		SAXParser saxParser = factory.newSAXParser();
		XMLReader xmlReader = saxParser.getXMLReader();
		xmlReader.setEntityResolver(IgnoreDtdEntityResolver.getInstance());
		StringWriter out = new StringWriter();
		OfxHtmlContentHandler contentHandler = new OfxHtmlContentHandler(writer,".");
		xmlReader.setContentHandler(contentHandler);
		xmlReader.parse(inputSource);
		writer.close();
		return out.toString();
	}
	{
		try
		{
			writer = XMLOutputFactory.newInstance().createXMLStreamWriter(out);
		}
		catch (XMLStreamException e1) {throw new IllegalStateException(e1);}
		catch (FactoryConfigurationError e1) {throw new IllegalStateException(e1);}
		return new FormattingXMLStreamWriter(writer);
	}
New to GrepCode? Check out our FAQ X