[Lift] Re: XHTML Validation and revised page re-writing

2009-08-26 Thread Justin Reardon

After updating, attempting to load any page results in the error
message below. Given the message, I'm guessing this isn't the fault of
my own code? Turning off validation as recommended causes the page to
load normally again.

The error:
Exception occured while processing /index
Message: org.xml.sax.SAXParseException: InvalidRegex: Pattern value '[-
+]?(\d+|\d+(\.\d+)?%)' is not a valid regular expression. The reported
error was: ''-' is an invalid character range. Write '\-'.'.

com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
(ErrorHandlerWrapper.java:236)
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
(ErrorHandlerWrapper.java:172)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
(XMLErrorReporter.java:382)

com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError
(XSDHandler.java:2241)

com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDAbstractTraverser.reportSchemaError
(XSDAbstractTraverser.java:612)

com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDSimpleTypeTraverser.traverseSimpleTypeDecl
(XSDSimpleTypeTraverser.java:390)

com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDSimpleTypeTraverser.traverseGlobal
(XSDSimpleTypeTraverser.java:140)

com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas
(XSDHandler.java:1090)

com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema
(XSDHandler.java:481)
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema
(XMLSchemaLoader.java:556)
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar
(XMLSchemaLoader.java:523)

com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema
(SchemaFactoryImpl.java:206)
javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489)
javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:521)
net.liftweb.http.GenericValidtor.schema(LiftRules.scala:1116)
net.liftweb.http.GenericValidtor.apply(LiftRules.scala:1119)
net.liftweb.http.GenericValidtor.apply(LiftRules.scala:1101)
net.liftweb.http.LiftSession$$anonfun$8.apply(LiftSession.scala:607)
net.liftweb.http.LiftSession$$anonfun$8.apply(LiftSession.scala:607)
scala.List.flatMap(List.scala:1132)
net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$merge
(LiftSession.scala:607)
net.liftweb.http.LiftSession$$anonfun$10$$anonfun$apply$30.apply
(LiftSession.scala:717)
net.liftweb.http.LiftSession$$anonfun$10$$anonfun$apply$30.apply
(LiftSession.scala:714)
net.liftweb.util.EmptyBox.or(Box.scala:374)
net.liftweb.http.LiftSession$$anonfun$10.apply(LiftSession.scala:711)
net.liftweb.http.LiftSession$$anonfun$10.apply(LiftSession.scala:704)
net.liftweb.util.EmptyBox.or(Box.scala:374)
net.liftweb.http.LiftSession.processRequest(LiftSession.scala:704)
net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
$dispatchStatefulRequest(LiftServlet.scala:229)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:146)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:146)
net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:911)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
$anonfun$apply$19.apply(S.scala:1051)
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:848)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
(S.scala:849)
net.liftweb.mapper.DB$$anon$1.net$liftweb$mapper$DB$$anon$$doWith
(DB.scala:119)
net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
$doWith$1.apply(DB.scala:120)
net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
$doWith$1.apply(DB.scala:120)
net.liftweb.mapper.DB$.use(DB.scala:322)
net.liftweb.mapper.DB$$anon$1.net$liftweb$mapper$DB$$anon$$doWith
(DB.scala:120)
net.liftweb.mapper.DB$$anon$1.apply(DB.scala:126)
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:849)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
$1.apply(S.scala:1049)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:1048)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun
$apply$22$$anonfun$apply$23$$anonfun$apply$24$$anonfun$apply$25$
$anonfun$apply$26$$anonfun$apply$27.apply(S.scala:1069)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun
$apply$22$$anonfun$apply$23$$anonfun$apply$24$$anonfun$apply$25$
$anonfun$apply$26.apply(S.scala:1068)

[Lift] Re: XHTML Validation and revised page re-writing

2009-08-26 Thread David Pollak
I've just pushed a new version live that will behave more gracefully if the
xsd cannot be loaded.

On Wed, Aug 26, 2009 at 5:17 PM, Justin Reardon justin.rear...@gmail.comwrote:


 After updating, attempting to load any page results in the error
 message below. Given the message, I'm guessing this isn't the fault of
 my own code? Turning off validation as recommended causes the page to
 load normally again.

 The error:
 Exception occured while processing /index
 Message: org.xml.sax.SAXParseException: InvalidRegex: Pattern value '[-
 +]?(\d+|\d+(\.\d+)?%)' is not a valid regular expression. The reported
 error was: ''-' is an invalid character range. Write '\-'.'.


 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException
 (ErrorHandlerWrapper.java:236)
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error
 (ErrorHandlerWrapper.java:172)
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError
 (XMLErrorReporter.java:382)


 com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError
 (XSDHandler.java:2241)


 com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDAbstractTraverser.reportSchemaError
 (XSDAbstractTraverser.java:612)


 com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDSimpleTypeTraverser.traverseSimpleTypeDecl
 (XSDSimpleTypeTraverser.java:390)


 com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDSimpleTypeTraverser.traverseGlobal
 (XSDSimpleTypeTraverser.java:140)


 com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas
 (XSDHandler.java:1090)


 com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema
 (XSDHandler.java:481)

  com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema
 (XMLSchemaLoader.java:556)

  com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar
 (XMLSchemaLoader.java:523)


 com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema
 (SchemaFactoryImpl.java:206)
javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489)
javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:521)
net.liftweb.http.GenericValidtor.schema(LiftRules.scala:1116)
net.liftweb.http.GenericValidtor.apply(LiftRules.scala:1119)
net.liftweb.http.GenericValidtor.apply(LiftRules.scala:1101)
net.liftweb.http.LiftSession$$anonfun$8.apply(LiftSession.scala:607)
net.liftweb.http.LiftSession$$anonfun$8.apply(LiftSession.scala:607)
scala.List.flatMap(List.scala:1132)
net.liftweb.http.LiftSession.net$liftweb$http$LiftSession$$merge
 (LiftSession.scala:607)
net.liftweb.http.LiftSession$$anonfun$10$$anonfun$apply$30.apply
 (LiftSession.scala:717)
net.liftweb.http.LiftSession$$anonfun$10$$anonfun$apply$30.apply
 (LiftSession.scala:714)
net.liftweb.util.EmptyBox.or(Box.scala:374)

  net.liftweb.http.LiftSession$$anonfun$10.apply(LiftSession.scala:711)

  net.liftweb.http.LiftSession$$anonfun$10.apply(LiftSession.scala:704)
net.liftweb.util.EmptyBox.or(Box.scala:374)
net.liftweb.http.LiftSession.processRequest(LiftSession.scala:704)
net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
 $dispatchStatefulRequest(LiftServlet.scala:229)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:146)
net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:146)
net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:911)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
 $anonfun$apply$19.apply(S.scala:1051)
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:848)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
 (S.scala:849)
net.liftweb.mapper.DB$$anon$1.net$liftweb$mapper$DB$$anon$$doWith
 (DB.scala:119)
net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
 $doWith$1.apply(DB.scala:120)
net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
 $doWith$1.apply(DB.scala:120)
net.liftweb.mapper.DB$.use(DB.scala:322)
net.liftweb.mapper.DB$$anon$1.net$liftweb$mapper$DB$$anon$$doWith
 (DB.scala:120)
net.liftweb.mapper.DB$$anon$1.apply(DB.scala:126)
net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:849)
net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
 $1.apply(S.scala:1049)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)

  net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:1048)

  net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun
 $apply$22$$anonfun$apply$23$$anonfun$apply$24$$anonfun$apply$25$
 $anonfun$apply$26$$anonfun$apply$27.apply(S.scala:1069)
net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)

  net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$$anonfun