You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2008/07/31 08:37:11 UTC

svn commit: r681281 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/Page.java

Author: ivaynberg
Date: Wed Jul 30 23:37:10 2008
New Revision: 681281

URL: http://svn.apache.org/viewvc?rev=681281&view=rev
Log:
WICKET-1652

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/Page.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/Page.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/Page.java?rev=681281&r1=681280&r2=681281&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/Page.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/Page.java Wed Jul 30 23:37:10 2008
@@ -1368,9 +1368,20 @@
 		if ((markupStream != null) && (markupStream.getXmlDeclaration() != null) &&
 			(application.getMarkupSettings().getStripXmlDeclarationFromOutput() == false))
 		{
-			response.write("<?xml version='1.0' encoding='");
+			// Gwyn - Wed, 21 May 2008 12:23:41
+			// If the xml declaration in the markup used double-quotes, use them in the output too
+			// Whether it should be or not, sometimes it's significant...
+			final String quoteChar = (markupStream.getXmlDeclaration().indexOf('\"') == -1) ? "'"
+				: "\"";
+
+			response.write("<?xml version=");
+			response.write(quoteChar);
+			response.write("1.0");
+			response.write(quoteChar);
+			response.write(" encoding=");
+			response.write(quoteChar);
 			response.write(encoding);
-			response.write("'?>");
+			response.write(quoteChar + "?>");
 		}
 
 		// Set response locale from session locale