/** * @see SerializationHandler#setTransformer(Transformer) */ public void setTransformer(Transformer transformer) { super.setTransformer(transformer); if (m_tracer != null && !(m_writer instanceof SerializerTraceWriter) ) setWriterInternal(new SerializerTraceWriter(m_writer, m_tracer), false); } /**
/** * Adds the given attribute to the set of collected attributes, * but only if there is a currently open element. * * @param name the attribute's qualified name * @param value the value of the attribute */ public void addAttribute(String name, final String value) { if (m_elemContext.m_startTagOpen) { final String patchedName = patchName(name); final String localName = getLocalName(patchedName); final String uri = getNamespaceURI(patchedName, false); addAttributeAlways(uri,localName, patchedName, "CDATA", value, false); } }
if (!foundURI) uri = ""; addCDATAElement(uri,localName); buf.setLength(0); foundURI = false; if (!foundURI) uri = ""; addCDATAElement(uri,localName);
/** * Entity reference event. * * @param name Name of entity * * @throws org.xml.sax.SAXException */ public void entityReference(String name) throws org.xml.sax.SAXException { flushPending(); startEntity(name); endEntity(name); if (m_tracer != null) fireEntityReference(name); }
/** * Adds the given xsl:attribute to the set of collected attributes, * but only if there is a currently open element. * * @param name the attribute's qualified name (prefix:localName) * @param value the value of the attribute * @param uri the URI that the prefix of the name points to */ public void addXSLAttribute(String name, final String value, final String uri) { if (m_elemContext.m_startTagOpen) { final String patchedName = patchName(name); final String localName = getLocalName(patchedName); addAttributeAlways(uri,localName, patchedName, "CDATA", value, true); } }
/** * This method gets the nodes value as a String and uses that String as if * it were an input character notification. * @param node the Node to serialize * @throws org.xml.sax.SAXException */ public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { flushPending(); String data = node.getNodeValue(); if (data != null) { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); } }
/** * @see org.xml.sax.ErrorHandler#fatalError(SAXParseException) */ public void fatalError(SAXParseException exc) throws SAXException { super.fatalError(exc); m_needToCallStartDocument = false; if (m_saxHandler instanceof ErrorHandler) { ((ErrorHandler)m_saxHandler).fatalError(exc); } }
/** * @see org.xml.sax.ErrorHandler#error(SAXParseException) */ public void error(SAXParseException exc) throws SAXException { super.error(exc); if (m_saxHandler instanceof ErrorHandler) ((ErrorHandler)m_saxHandler).error(exc); }
/** * Receive notification of a comment. * * @see ExtendedLexicalHandler#comment(String) */ public void comment(String data) throws SAXException { m_docIsEmpty = false; final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
super.fireCDATAEvent(ch, old_start, length);
/** * This method adds an attribute the the current element, * but should not be used for an xsl:attribute child. * @see ExtendedContentHandler#addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException { if (m_elemContext.m_startTagOpen) { addAttributeAlways(uri, localName, rawName, type, value, false); } }
super.addAttributes(atts);
String doctypeSystem = getDoctypeSystem(); if (doctypeSystem != null && m_lexHandler != null) String doctypePublic = getDoctypePublic(); if (doctypeSystem != null) m_lexHandler.startDTD( addAttributes(atts); m_elemContext.m_isCdataSection = isCdataSection();
/** * Receive notification of character data. * * @param characters The string of characters to process. * * @throws org.xml.sax.SAXException * * @see ExtendedContentHandler#characters(String) */ public void characters(String characters) throws SAXException { final int len = characters.length(); if (len > m_charsBuff.length) { m_charsBuff = new char[len*2 + 1]; } characters.getChars(0,len, m_charsBuff, 0); characters(m_charsBuff, 0, len); }
/** * Entity reference event. * * @param name Name of entity * * @throws org.xml.sax.SAXException */ public void entityReference(String name) throws org.xml.sax.SAXException { flushPending(); startEntity(name); endEntity(name); if (m_tracer != null) fireEntityReference(name); }
/** * This method gets the nodes value as a String and uses that String as if * it were an input character notification. * @param node the Node to serialize * @throws org.xml.sax.SAXException */ public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException { flushPending(); String data = node.getNodeValue(); if (data != null) { final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); characters(m_charsBuff, 0, length); } }
/** * @see org.xml.sax.ErrorHandler#fatalError(SAXParseException) */ public void fatalError(SAXParseException exc) throws SAXException { super.fatalError(exc); m_needToCallStartDocument = false; if (m_saxHandler instanceof ErrorHandler) { ((ErrorHandler)m_saxHandler).fatalError(exc); } }
/** * @see org.xml.sax.ErrorHandler#error(SAXParseException) */ public void error(SAXParseException exc) throws SAXException { super.error(exc); if (m_saxHandler instanceof ErrorHandler) ((ErrorHandler)m_saxHandler).error(exc); }
/** * Receive notification of a comment. * * @see ExtendedLexicalHandler#comment(String) */ public void comment(String data) throws SAXException { m_docIsEmpty = false; final int length = data.length(); if (length > m_charsBuff.length) { m_charsBuff = new char[length * 2 + 1]; } data.getChars(0, length, m_charsBuff, 0); comment(m_charsBuff, 0, length); }
super.fireCDATAEvent(ch, start, length);