You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mi...@apache.org on 2005/06/01 21:17:08 UTC
cvs commit: xml-xalan/java/src/org/apache/xml/serializer OutputPropertiesFactory.java ToStream.java
minchau 2005/06/01 12:17:08
Modified: java/src/org/apache/xml/serializer
OutputPropertiesFactory.java ToStream.java
Log:
Applying patcth for JIRA XALANJ-2093
adding a xalan:line-separator extension output attribute.
Revision Changes Path
1.11 +9 -1 xml-xalan/java/src/org/apache/xml/serializer/OutputPropertiesFactory.java
Index: OutputPropertiesFactory.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/serializer/OutputPropertiesFactory.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- OutputPropertiesFactory.java 7 Apr 2005 04:29:03 -0000 1.10
+++ OutputPropertiesFactory.java 1 Jun 2005 19:17:08 -0000 1.11
@@ -118,6 +118,14 @@
*/
public static final String S_KEY_INDENT_AMOUNT =
S_BUILTIN_EXTENSIONS_UNIVERSAL + "indent-amount";
+
+ /**
+ * The non-standard property key to use to set the
+ * number of whitepaces to indent by, per indentation level,
+ * if indent="yes".
+ */
+ public static final String S_KEY_LINE_SEPARATOR =
+ S_BUILTIN_EXTENSIONS_UNIVERSAL + "line-separator";
/** This non-standard property key is used to set the name of the fully qualified
* Java class that implements the ContentHandler interface.
1.43 +15 -3 xml-xalan/java/src/org/apache/xml/serializer/ToStream.java
Index: ToStream.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/serializer/ToStream.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- ToStream.java 7 Apr 2005 04:29:03 -0000 1.42
+++ ToStream.java 1 Jun 2005 19:17:08 -0000 1.43
@@ -109,8 +109,11 @@
/**
* The system line separator for writing out line breaks.
+ * The default value is from the system property,
+ * but this value can be set through the xsl:output
+ * extension attribute xalan:line-separator.
*/
- protected final char[] m_lineSep =
+ protected char[] m_lineSep =
System.getProperty("line.separator").toCharArray();
/**
@@ -122,7 +125,7 @@
* The length of the line seperator, since the write is done
* one character at a time.
*/
- protected final int m_lineSepLen = m_lineSep.length;
+ protected int m_lineSepLen = m_lineSep.length;
/**
* Map that tells which characters should have special treatment, and it
@@ -454,6 +457,15 @@
format));
setIndent(
OutputPropertyUtils.getBooleanProperty(OutputKeys.INDENT, format));
+
+ {
+ String sep =
+ format.getProperty(OutputPropertiesFactory.S_KEY_LINE_SEPARATOR);
+ if (sep != null) {
+ m_lineSep = sep.toCharArray();
+ m_lineSepLen = sep.length();
+ }
+ }
boolean shouldNotWriteXMLHeader =
OutputPropertyUtils.getBooleanProperty(
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org