[jboss-cvs] JBossAS SVN: r65521 - trunk/server/src/main/org/jboss/metadata.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Sep 21 04:43:48 EDT 2007
Author: dimitris at jboss.org
Date: 2007-09-21 04:43:48 -0400 (Fri, 21 Sep 2007)
New Revision: 65521
Modified:
trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java
Log:
JBAS-4741, correct the public ID, remove the extra slash '/'
(revert JBCOMMON-23)
Modified: trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java 2007-09-21 08:35:25 UTC (rev 65520)
+++ trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java 2007-09-21 08:43:48 UTC (rev 65521)
@@ -299,7 +299,8 @@
* only for error reporting.
* @return Document
*/
- public Document getDocument(InputSource is, String inPath) throws DeploymentException
+ public Document getDocument(InputSource is, String inPath)
+ throws DeploymentException
{
try
{
@@ -318,30 +319,25 @@
//docBuilderFactory.setAttribute
// ("http://java.sun.com/xml/jaxp/properties/schemaLanguage","http://www.w3.org/2001/XMLSchema");
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
+ JBossEntityResolver lr = new JBossEntityResolver();
+ LocalErrorHandler eh = new LocalErrorHandler( inPath, lr );
+ docBuilder.setEntityResolver(lr);
+ docBuilder.setErrorHandler(eh );
- // [JBCOMMON-23] JBossEntityResolver does not register jboss-app_5_0.dtd
- JBossEntityResolver entityResolver = new JBossEntityResolver();
- JBossEntityResolver.registerEntity("-//JBoss//DTD Java EE Application 4.2///EN", "jboss-app_4_2.dtd");
- JBossEntityResolver.registerEntity("-//JBoss//DTD Java EE Application 5.0///EN", "jboss-app_5_0.dtd");
-
- LocalErrorHandler errorHandler = new LocalErrorHandler(inPath, entityResolver);
- docBuilder.setEntityResolver(entityResolver);
- docBuilder.setErrorHandler(errorHandler);
-
Document doc = docBuilder.parse(is);
- if (validateDTDs && errorHandler.hadError())
+ if(validateDTDs && eh.hadError())
{
- throw new DeploymentException("Invalid XML: file=" + inPath, errorHandler.getException());
+ throw new DeploymentException("Invalid XML: file=" + inPath, eh.getException());
}
return doc;
}
- catch (DeploymentException e)
+ catch (DeploymentException e)
{
throw e;
}
catch (SAXParseException e)
{
- String msg = "Invalid XML: file=" + inPath + "@" + e.getColumnNumber() + ":" + e.getLineNumber();
+ String msg = "Invalid XML: file=" + inPath+"@"+e.getColumnNumber()+":"+e.getLineNumber();
throw new DeploymentException(msg, e);
}
catch (SAXException e)
More information about the jboss-cvs-commits
mailing list