JSP compilation error upon changing XML parser to Xerces

Posted by elduff on Stack Overflow See other posts from Stack Overflow or by elduff
Published on 2010-04-19T17:57:23Z Indexed on 2010/04/20 0:13 UTC
Read the original article Hit count: 733

Filed under:
|
|
|
|

All, I'm working on a java webapp that we deploy in the Resin web app server. I have been doing some XML parsing for a new part of the application, and realized that our app was using Resin classes to do the parsing. I wanted to get away from that and use something more standard for a number of reasons, so I set these system properties in my resin config file (and added the xerces jar to my classpath):

<system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>

<system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/>

And, now I'm getting JSP compilation errors on several pages (I guess Resin's built in parser was more lenient). The error reads:

org.xml.sax.SAXParseException: The value of attribute "title" associated with an element type "display:column" must not contain the '<' character.

And, the 'display:column' tag on some pages does indeed contain markup in the 'title' attribute. Here's an example:

<display:column scope='col' class=" appealColorBG  selectAllWidth" 
    title="<span class='centerThis'><label for='selectAll'>Select All</label><br />
            <input type='checkbox' name='selectAll' 
            id='selectAll' 
            onClick='selectAllCheckboxes();'/></span> " >

That's some ugly JSP code, I know, but it's also code that's already in production, so I'm hesitant to change it.

Does anyone know of a way that I can set xerces so that it will allow the JSP to compile as is?

© Stack Overflow or respective owner

Related posts about jsp

Related posts about Xml