W3C home > Mailing lists > Public > www-validator-cvs@w3.org > May 2010

2006/unicorn/src/org/w3c/unicorn/response/impl DefaultMessageXBeans.java,1.4,1.5

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 14 May 2010 16:07:53 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1OCxQX-0004ta-Ob@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl
In directory hutz:/tmp/cvs-serv18798/src/org/w3c/unicorn/response/impl

Modified Files:
	DefaultMessageXBeans.java 
Log Message:
fixed: in specific cases a message description was not correctly transcribed 

Index: DefaultMessageXBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/DefaultMessageXBeans.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- DefaultMessageXBeans.java	23 Oct 2009 12:36:13 -0000	1.4
+++ DefaultMessageXBeans.java	14 May 2010 16:07:51 -0000	1.5
@@ -54,10 +54,15 @@
 		if (message.isSetGroup())
 			group = message.getGroup();
 		
-		if (message.isSetDescription())
-			description = message.getDescription().xmlText(new XmlOptions().setUseDefaultNamespace()
-					.setSavePrettyPrint()).replaceAll("</?xml-fragment[^>]*>", "").replaceAll("xmlns=\".*\"", "");
-	
+		if (message.isSetDescription()) {
+			XmlOptions opts = new XmlOptions();
+			opts.setSaveCDataLengthThreshold(10000000);
+			opts.setSaveCDataEntityCountThreshold(-1);
+			opts.setUseDefaultNamespace();
+			description = message.getDescription().xmlText(opts)
+				.replaceAll("[ ]*xmlns=\"[^>]*\"", "").replaceAll("</?xml-fragment[^>]*>", "");
+		}
+		
 		for (ContextType context : message.getContextList())
 			contexts.add(new DefaultContextXBeans(context));
 	}
Received on Friday, 14 May 2010 16:07:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:42 UTC