/** * Parse an xml root element. * * @param root * the root ele * @param resource * the resource containing the root ele * @param context * the parser context * @return the paxml entity, return null if root tag is unknown. */ public IEntity parseXml(OMElement root, PaxmlResource resource, IParserContext context) { if (context == null) { context = AbstractPaxmlEntityFactory.createParserContext(root, resource, getResourceLocator()); } String tagName = root.getQName().getLocalPart(); IEntityFactory factory = registry.lookup(tagName); if (factory == null) { if (log.isWarnEnabled()) { log.warn("Entity factory not found for root tag <" + tagName + "> in resource: " + resource); } return null; } IEntity entity = factory.create(root, context); return entity; }
/** * Parse an xml root element. * * @param root * the root ele * @param resource * the resource containing the root ele * @param context * the parser context * @return the paxml entity, return null if root tag is unknown. */ public IEntity parseXml(OMElement root, PaxmlResource resource, IParserContext context) { if (context == null) { context = AbstractPaxmlEntityFactory.createParserContext(root, resource, getResourceLocator()); } String tagName = root.getQName().getLocalPart(); IEntityFactory factory = registry.lookup(tagName); if (factory == null) { if (log.isWarnEnabled()) { log.warn("Entity factory not found for root tag <" + tagName + "> in resource: " + resource); } return null; } IEntity entity = factory.create(root, context); return entity; }