private Configuration createSitemapProgram(Source sitemapSource) throws ProcessingException, SAXException, IOException { // do we validate? Default is false final String value = this.settings.getProperty("org.apache.cocoon.sitemap.validating", "false"); if ( Boolean.valueOf(value).booleanValue() ) { if ( this.getLogger().isDebugEnabled() ) { this.getLogger().debug("Validating sitemap " + sitemapSource.getURI()); } final Validator validator = this.sitemapSchema.newValidator(); validator.validate(new StreamSource(sitemapSource.getInputStream())); } NamespacedSAXConfigurationHandler handler = new NamespacedSAXConfigurationHandler(); AnnotationsFilter annotationsFilter = new AnnotationsFilter(handler); SourceUtil.toSAX(this.manager, sitemapSource, null, annotationsFilter); return handler.getConfiguration(); }
createConfiguration( localName, namespaceURI, getLocationString() ); this.startPrefixMapping( attributes.getLocalName( i ), attributes.getValue( i ) );
/** * Get a SAXConfigurationHandler for your configuration reading. * @return a <code>SAXConfigurationHandler</code> */ protected SAXConfigurationHandler getHandler() { try { if( m_parser.getFeature( "http://xml.org/sax/features/namespaces" ) ) { return new NamespacedSAXConfigurationHandler(); } } catch( Exception e ) { // ignore error and fall through to the non-namespaced version } return new SAXConfigurationHandler(); }
while( i.hasNext() ) endPrefixMapping( (String)i.next() );