NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 856 - LABEL with for attribute to non-existant ID causes internal error
LABEL with for attribute to non-existant ID causes internal error
Status: RESOLVED FIXED
Product: Validator.nu
Classification: Unclassified
Component: Schematron back end
HEAD
All All
: P2 major
Assigned To: Michael[tm] Smith
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-25 22:30 CEST by Russ Tennant
Modified: 2011-10-24 13:38 CEST (History)
1 user (show)

See Also:


Attachments
Validator Error Settings Screenshot (62.96 KB, image/png)
2011-08-26 01:41 CEST, Russ Tennant
Details
patch (635 bytes, patch)
2011-10-19 11:59 CEST, Michael[tm] Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Russ Tennant 2011-08-25 22:30:31 CEST
Using text field validation option with the following HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
<p><label for="foo">foo</label></p>
</body>
</html>



Triggers


011-08-25 14:17:20.986:INFO::Started SocketConnector@localhost:8011
nu.validator.servlet.VerifierServletTransaction - RuntimeException, doc: null schema:  lax: false
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.StringBuffer.charAt(StringBuffer.java:162)
        at com.thaiopensource.validate.schematron.OutputHandler.startElement(Unknown Source)
        at net.sf.saxon.event.ContentHandlerProxy.startContent(ContentHandlerProxy.java:362)
        at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:197)
        at net.sf.saxon.event.ComplexContentOutputter.startContent(ComplexContentOutputter.java:550)
        at net.sf.saxon.event.ComplexContentOutputter.characters(ComplexContentOutputter.java:157)
        at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:245)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
        at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:686)
        at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
        at net.sf.saxon.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:527)
        at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:259)
        at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:281)
        at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
        at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
        at net.sf.saxon.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:527)
        at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:212)
        at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:170)
        at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
        at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
        at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
        at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
        at net.sf.saxon.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:144)
        at com.thaiopensource.xml.sax.ForkContentHandler.endDocument(Unknown Source)
        at com.thaiopensource.xml.sax.ForkContentHandler.endDocument(Unknown Source)
        at nu.validator.xml.AttributesPermutingXMLReaderWrapper.endDocument(AttributesPermutingXMLReaderWrapper.java:158)
        at nu.validator.xml.CombineContentHandler.endDocument(CombineContentHandler.java:64)
        at nu.validator.htmlparser.sax.SAXStreamer.end(SAXStreamer.java:154)
        at nu.validator.htmlparser.impl.TreeBuilder.endTokenization(TreeBuilder.java:1571)
        at nu.validator.htmlparser.impl.Tokenizer.end(Tokenizer.java:6518)
        at nu.validator.htmlparser.io.Driver.tokenize(Driver.java:239)
        at nu.validator.htmlparser.sax.HtmlParser.tokenize(HtmlParser.java:480)
        at nu.validator.htmlparser.sax.HtmlParser.parse(HtmlParser.java:423)
        at nu.validator.xml.WiretapXMLReaderWrapper.parse(WiretapXMLReaderWrapper.java:152)
        at nu.validator.xml.AttributesPermutingXMLReaderWrapper.parse(AttributesPermutingXMLReaderWrapper.java:285)
        at nu.validator.servlet.VerifierServletTransaction.validate(VerifierServletTransaction.java:888)
        at nu.validator.servlet.PageEmitter.emit(PageEmitter.java:28)
        at nu.validator.servlet.VerifierServletTransaction.service(VerifierServletTransaction.java:694)
        at nu.validator.servlet.VerifierServlet.doPost(VerifierServlet.java:214)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1221)
        at nu.validator.servlet.MultipartFormDataFilter.doFilter(MultipartFormDataFilter.java:180)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at nu.validator.servletfilter.InboundGzipFilter.doFilter(InboundGzipFilter.java:57)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at nu.validator.servletfilter.InboundSizeLimitFilter.doFilter(InboundSizeLimitFilter.java:62)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:78)
        at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:131)
        at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
        at org.mortbay.jetty.Server.handle(Server.java:326)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
        at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Comment 1 Michael[tm] Smith 2011-08-25 22:52:20 CEST
I can't reproduce this in my workspace. But I'll check out another copy and build from scratch and see if I can reproduce it that way.
Comment 2 Russ Tennant 2011-08-26 01:41:41 CEST
Created attachment 212 [details]
Validator Error Settings Screenshot
Comment 3 Michael[tm] Smith 2011-10-19 11:59:51 CEST
Created attachment 213 [details]
patch