public void writeStartElement(final String tagName) throws XmlStreamException { // writeStartElement(tagName.toCharArray()) ; try { closeStartTagIfNecessary(); m_indenter.indent(m_writer, m_tagStack.size()); m_writer.write(SINGLE_LT_CHARS); // MrPperf - ('<'); m_writer.write(tagName); } catch (IOException e) { throw new XmlStreamException(e); } m_tagStack.add(tagName); m_inStartTag = true; }
// MrPperf - more efficient to be able to write elements as char[] vs tagName String public void writeStartElement(final char[] tagNameAsChars) throws XmlStreamException { try { closeStartTagIfNecessary(); m_indenter.indent(m_writer, m_tagStack.size()); m_writer.write(SINGLE_LT_CHARS); // MrPperf - ('<'); m_writer.write(tagNameAsChars); } catch (IOException e) { throw new XmlStreamException(e); } // MrPPerf -- FIX ME String tagName = new String(tagNameAsChars); m_tagStack.add(tagName); m_inStartTag = true; }
public void writeEndElement() throws XmlStreamException { // MrPperf - stack is now of type char[] final String tagName = m_tagStack.remove(m_tagStack.size() - 1); try { if (m_inStartTag) { m_writer.write(SLASH_CHARS); writeClosingStartTag(); } else { m_indenter.indent(m_writer, m_tagStack.size()); m_writer.write(LT_SLASH_CHARS); // MrPperf - ("</"); m_writer.write(tagName); m_writer.write(SINGLE_GT_CHARS); // MrPperf - ('>'); } } catch (IOException e) { throw new XmlStreamException(e); } }