39 *
40 * This class is used explicitly in code generated by XSLTC,
41 * so it is "public", but it should
42 * be viewed as internal or package private, this is not an API.
43 *
44 * @xsl.usage internal
45 */
46 public final class ToXMLStream extends ToStream
47 {
48
49 /**
50 * remembers if we need to write out "]]>" to close the CDATA
51 */
52 boolean m_cdataTagOpen = false;
53
54
55 /**
56 * Map that tells which XML characters should have special treatment, and it
57 * provides character to entity name lookup.
58 */
59 private CharInfo m_xmlcharInfo =
60 // new CharInfo(CharInfo.XML_ENTITIES_RESOURCE);
61 CharInfo.getCharInfo(CharInfo.XML_ENTITIES_RESOURCE, Method.XML);
62
63 /**
64 * Default constructor.
65 */
66 public ToXMLStream()
67 {
68 m_charInfo = m_xmlcharInfo;
69
70 initCDATA();
71 // initialize namespaces
72 m_prefixMap = new NamespaceMappings();
73
74 }
75
76 /**
77 * Copy properties from another SerializerToXML.
78 *
79 * @param xmlListener non-null reference to a SerializerToXML object.
312 writer.write(data.substring(0, indexOfQLT));
313 }
314
315 writer.write("? >"); // add space between.
316
317 if ((indexOfQLT + 2) < data.length())
318 {
319 writer.write(data.substring(indexOfQLT + 2));
320 }
321 }
322 else
323 {
324 writer.write(data);
325 }
326
327 writer.write('?');
328 writer.write('>');
329
330 /**
331 * Before Xalan 1497, a newline char was printed out if not inside of an
332 * element. The whitespace is not significant if the output is standalone
333 */
334 if (m_elemContext.m_currentElemDepth <= 0 && m_isStandalone)
335 writer.write(m_lineSep, 0, m_lineSepLen);
336
337 /*
338 * Don't write out any indentation whitespace now,
339 * because there may be non-whitespace text after this.
340 *
341 * Simply mark that at this point if we do decide
342 * to indent that we should
343 * add a newline on the end of the current line before
344 * the indentation at the start of the next line.
345 */
346 m_startNewLine = true;
347 }
348 catch(IOException e)
349 {
350 throw new SAXException(e);
351 }
352 }
353
354 if (m_tracer != null)
355 super.fireEscapingEvent(target, data);
356 }
|
39 *
40 * This class is used explicitly in code generated by XSLTC,
41 * so it is "public", but it should
42 * be viewed as internal or package private, this is not an API.
43 *
44 * @xsl.usage internal
45 */
46 public final class ToXMLStream extends ToStream
47 {
48
49 /**
50 * remembers if we need to write out "]]>" to close the CDATA
51 */
52 boolean m_cdataTagOpen = false;
53
54
55 /**
56 * Map that tells which XML characters should have special treatment, and it
57 * provides character to entity name lookup.
58 */
59 private static CharInfo m_xmlcharInfo =
60 // new CharInfo(CharInfo.XML_ENTITIES_RESOURCE);
61 CharInfo.getCharInfo(CharInfo.XML_ENTITIES_RESOURCE, Method.XML);
62
63 /**
64 * Default constructor.
65 */
66 public ToXMLStream()
67 {
68 m_charInfo = m_xmlcharInfo;
69
70 initCDATA();
71 // initialize namespaces
72 m_prefixMap = new NamespaceMappings();
73
74 }
75
76 /**
77 * Copy properties from another SerializerToXML.
78 *
79 * @param xmlListener non-null reference to a SerializerToXML object.
312 writer.write(data.substring(0, indexOfQLT));
313 }
314
315 writer.write("? >"); // add space between.
316
317 if ((indexOfQLT + 2) < data.length())
318 {
319 writer.write(data.substring(indexOfQLT + 2));
320 }
321 }
322 else
323 {
324 writer.write(data);
325 }
326
327 writer.write('?');
328 writer.write('>');
329
330 /**
331 * Before Xalan 1497, a newline char was printed out if not inside of an
332 * element. The whitespace is not significant is the output is standalone
333 */
334 if (m_elemContext.m_currentElemDepth <= 0 && m_isStandalone)
335 writer.write(m_lineSep, 0, m_lineSepLen);
336
337
338 /*
339 * Don't write out any indentation whitespace now,
340 * because there may be non-whitespace text after this.
341 *
342 * Simply mark that at this point if we do decide
343 * to indent that we should
344 * add a newline on the end of the current line before
345 * the indentation at the start of the next line.
346 */
347 m_startNewLine = true;
348 }
349 catch(IOException e)
350 {
351 throw new SAXException(e);
352 }
353 }
354
355 if (m_tracer != null)
356 super.fireEscapingEvent(target, data);
357 }
|