/** * Parse the specified XML document, and return a <code>TreeNode</code> * that corresponds to the root node of the document tree. * * @param uri URI of the XML document being parsed * @param is Input source containing the deployment descriptor * * @exception JasperException if an I/O or parsing error has occurred */ public TreeNode parseXMLDocument(String uri, InputSource is) throws JasperException { return parseXMLDocument(uri, is, false); }
/** * Sets the path prefix for .dtd resources */ public static void setDtdResourcePrefix(String prefix) { ParserUtils.setDtdResourcePrefix(prefix); } // END PWC 6386258
/** * Sets the path prefix for .xsd resources */ public static void setSchemaResourcePrefix(String prefix) { ParserUtils.setSchemaResourcePrefix(prefix); }
private String getUriFromTld(String resourcePath, InputStream in) throws JasperException { // Parse the tag library descriptor at the specified resource path /* SJSAS 6384538 TreeNode tld = new ParserUtils().parseXMLDocument(resourcePath, in); */ // START SJSAS 6384538 TreeNode tld = new ParserUtils().parseXMLDocument( resourcePath, in, options.isValidationEnabled()); // END SJSAS 6384538 TreeNode uri = tld.findChild("uri"); if (uri != null) { String body = uri.getBody(); if (body != null) return body; } return null; }
TreeNode treeChild = convert(treeNode, child);
ParserUtils.setSchemaResourcePrefix(schemas.toURI().toURL().toString()); ParserUtils.setDtdResourcePrefix(dtds.toURI().toURL().toString()); ParserUtils.setEntityResolver(habitat.getComponent(EntityResolver.class, "web")); } catch (MalformedURLException e) { _logger.log(Level.SEVERE, "webContainer.exceptionSetSchemasDtdsLocation", e);
/** * Sets the path prefix URL for .xsd resources */ public static void setSchemaResourcePrefix(String prefix) { if (prefix != null && prefix.startsWith("file:")) { schemaResourcePrefix = uencode(prefix); isSchemaResourcePrefixFileUrl = true; } else { schemaResourcePrefix = prefix; isSchemaResourcePrefixFileUrl = false; } for (int i=0; i<CACHED_SCHEMA_RESOURCE_PATHS.length; i++) { String path = DEFAULT_SCHEMA_RESOURCE_PATHS[i]; int index = path.lastIndexOf('/'); if (index != -1) { CACHED_SCHEMA_RESOURCE_PATHS[i] = schemaResourcePrefix + path.substring(index+1); } } }
String schemaLocation = map.item(i).getNodeValue(); if (Constants.SCHEMA_LOCATION_JSP_20.equals(schemaLocation)) { schema = getSchema( Constants.TAGLIB_SCHEMA_PUBLIC_ID_20); break; } else if (Constants.SCHEMA_LOCATION_JSP_21.equals( schemaLocation)) { schema = getSchema( Constants.TAGLIB_SCHEMA_PUBLIC_ID_21); break; } else if (Constants.SCHEMA_LOCATION_WEBAPP_24.equals( schemaLocation)) { schema = getSchema( Constants.WEBAPP_SCHEMA_PUBLIC_ID_24); break; } else if (Constants.SCHEMA_LOCATION_WEBAPP_25.equals( schemaLocation)) { schema = getSchema( Constants.WEBAPP_SCHEMA_PUBLIC_ID_25); break;
private void tldScanStream(String resourcePath, String entryName, InputStream stream) throws IOException { try { // Parse the tag library descriptor at the specified resource path String uri = null; TreeNode tld = new ParserUtils().parseXMLDocument(resourcePath, stream); TreeNode uriNode = tld.findChild("uri"); if (uriNode != null) { String body = uriNode.getBody(); if (body != null) uri = body; } // Add implicit map entry only if its uri is not already // present in the map if (uri != null && mappings.get(uri) == null) { TldLocation location; if (entryName == null) { location = new TldLocation(resourcePath); } else { location = new TldLocation(entryName, resourcePath); } mappings.put(uri, location); } } catch (JasperException e) { // Hack - makes exception handling simpler throw new IOException(e); } }
convert(treeNode, child);
/** * Sets the path prefix URL for .xsd resources */ public static void setSchemaResourcePrefix(String prefix) { if (prefix != null && prefix.startsWith("file:")) { schemaResourcePrefix = uencode(prefix); isSchemaResourcePrefixFileUrl = true; } else { schemaResourcePrefix = prefix; isSchemaResourcePrefixFileUrl = false; } for (int i=0; i<CACHED_SCHEMA_RESOURCE_PATHS.length; i++) { String path = DEFAULT_SCHEMA_RESOURCE_PATHS[i]; int index = path.lastIndexOf('/'); if (index != -1) { CACHED_SCHEMA_RESOURCE_PATHS[i] = schemaResourcePrefix + path.substring(index+1); } } }
String schemaLocation = map.item(i).getNodeValue(); if (Constants.SCHEMA_LOCATION_JSP_20.equals(schemaLocation)) { schema = getSchema( Constants.TAGLIB_SCHEMA_PUBLIC_ID_20); break; } else if (Constants.SCHEMA_LOCATION_JSP_21.equals( schemaLocation)) { schema = getSchema( Constants.TAGLIB_SCHEMA_PUBLIC_ID_21); break; } else if (Constants.SCHEMA_LOCATION_WEBAPP_24.equals( schemaLocation)) { schema = getSchema( Constants.WEBAPP_SCHEMA_PUBLIC_ID_24); break; } else if (Constants.SCHEMA_LOCATION_WEBAPP_25.equals( schemaLocation)) { schema = getSchema( Constants.WEBAPP_SCHEMA_PUBLIC_ID_25); break;
new ParserUtils().parseXMLDocument(resourcePath, stream); TreeNode uriNode = tld.findChild("uri"); if (uriNode != null) {
/** * Parse the specified XML document, and return a <code>TreeNode</code> * that corresponds to the root node of the document tree. * * @param uri URI of the XML document being parsed * @param is Input source containing the deployment descriptor * * @exception JasperException if an I/O or parsing error has occurred */ public TreeNode parseXMLDocument(String uri, InputSource is) throws JasperException { return parseXMLDocument(uri, is, false); }
convert(treeNode, child);
/** * Sets the path prefix for .dtd resources */ public static void setDtdResourcePrefix(String prefix) { ParserUtils.setDtdResourcePrefix(prefix); } // END PWC 6386258
/** * Sets the path prefix for .xsd resources */ public static void setSchemaResourcePrefix(String prefix) { ParserUtils.setSchemaResourcePrefix(prefix); }