String prefix = decl.getPrefix(); String uri = decl.getURI(); if(null == uri) uri = ""; decl = new XMLNSDecl(nsAlias.getStylesheetPrefix(), nsAlias.getResultNamespace(), shouldExclude); decl = new XMLNSDecl(prefix, uri, shouldExclude); boolean shouldExclude = excludeResultNSDecl(decl.getPrefix(), decl.getURI()); if (shouldExclude != decl.getIsExcluded()) decl = new XMLNSDecl(decl.getPrefix(), decl.getURI(), shouldExclude);
if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true);
if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) rhandler.endPrefixMapping(decl.getPrefix());
private boolean declaredXSLNS(Stylesheet stylesheet) { List declaredPrefixes = stylesheet.getDeclaredPrefixes(); int n = declaredPrefixes.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) declaredPrefixes.get(i); if(decl.getURI().equals(Constants.S_XSLNAMESPACEURL)) return true; } return false; } }
/** * Add or replace this namespace declaration in list * of namespaces in scope for this element. * * @param newDecl namespace declaration to add to list */ void addOrReplaceDecls(XMLNSDecl newDecl) { int n = m_prefixTable.size(); for (int i = n - 1; i >= 0; i--) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (decl.getPrefix().equals(newDecl.getPrefix())) { return; } } m_prefixTable.add(newDecl); }
/** * Copy the namespace declarations from the NamespaceSupport object. * Take care to call resolveInheritedNamespaceDecls. * after all namespace declarations have been added. * * @param nsSupport non-null reference to NamespaceSupport from * the ContentHandler. * @param excludeXSLDecl true if XSLT namespaces should be ignored. * * @throws TransformerException */ public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl) throws TransformerException { Enumeration decls = nsSupport.getDeclaredPrefixes(); while (decls.hasMoreElements()) { String prefix = (String) decls.nextElement(); if (null == m_declaredPrefixes) m_declaredPrefixes = new ArrayList(); String uri = nsSupport.getURI(prefix); if (excludeXSLDecl && uri.equals(Constants.S_XSLNAMESPACEURL)) continue; // System.out.println("setPrefixes - "+prefix+", "+uri); XMLNSDecl decl = new XMLNSDecl(prefix, uri, false); m_declaredPrefixes.add(decl); } }
if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true);
if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) rhandler.endPrefixMapping(decl.getPrefix());
private boolean declaredXSLNS(Stylesheet stylesheet) { List declaredPrefixes = stylesheet.getDeclaredPrefixes(); int n = declaredPrefixes.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) declaredPrefixes.get(i); if(decl.getURI().equals(Constants.S_XSLNAMESPACEURL)) return true; } return false; } }
/** * Add or replace this namespace declaration in list * of namespaces in scope for this element. * * @param newDecl namespace declaration to add to list */ void addOrReplaceDecls(XMLNSDecl newDecl) { int n = m_prefixTable.size(); for (int i = n - 1; i >= 0; i--) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (decl.getPrefix().equals(newDecl.getPrefix())) { return; } } m_prefixTable.add(newDecl); }
/** * Copy the namespace declarations from the NamespaceSupport object. * Take care to call resolveInheritedNamespaceDecls. * after all namespace declarations have been added. * * @param nsSupport non-null reference to NamespaceSupport from * the ContentHandler. * @param excludeXSLDecl true if XSLT namespaces should be ignored. * * @throws TransformerException */ public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl) throws TransformerException { Enumeration decls = nsSupport.getDeclaredPrefixes(); while (decls.hasMoreElements()) { String prefix = (String) decls.nextElement(); if (null == m_declaredPrefixes) m_declaredPrefixes = new ArrayList(); String uri = nsSupport.getURI(prefix); if (excludeXSLDecl && uri.equals(Constants.S_XSLNAMESPACEURL)) continue; // System.out.println("setPrefixes - "+prefix+", "+uri); XMLNSDecl decl = new XMLNSDecl(prefix, uri, false); m_declaredPrefixes.add(decl); } }
String prefix = decl.getPrefix(); String uri = decl.getURI(); if(null == uri) uri = ""; decl = new XMLNSDecl(nsAlias.getStylesheetPrefix(), nsAlias.getResultNamespace(), shouldExclude); decl = new XMLNSDecl(prefix, uri, shouldExclude); boolean shouldExclude = excludeResultNSDecl(decl.getPrefix(), decl.getURI()); if (shouldExclude != decl.getIsExcluded()) decl = new XMLNSDecl(decl.getPrefix(), decl.getURI(), shouldExclude);
if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) rhandler.startPrefixMapping(decl.getPrefix(), decl.getURI(), true);
if (!decl.getIsExcluded() && !(null != ignorePrefix && decl.getPrefix().equals(ignorePrefix))) rhandler.endPrefixMapping(decl.getPrefix());
private boolean declaredXSLNS(Stylesheet stylesheet) { List declaredPrefixes = stylesheet.getDeclaredPrefixes(); int n = declaredPrefixes.size(); for (int i = 0; i < n; i++) { XMLNSDecl decl = (XMLNSDecl) declaredPrefixes.get(i); if(decl.getURI().equals(Constants.S_XSLNAMESPACEURL)) return true; } return false; } }
/** * Add or replace this namespace declaration in list * of namespaces in scope for this element. * * @param newDecl namespace declaration to add to list */ void addOrReplaceDecls(XMLNSDecl newDecl) { int n = m_prefixTable.size(); for (int i = n - 1; i >= 0; i--) { XMLNSDecl decl = (XMLNSDecl) m_prefixTable.get(i); if (decl.getPrefix().equals(newDecl.getPrefix())) { return; } } m_prefixTable.add(newDecl); }
/** * Copy the namespace declarations from the NamespaceSupport object. * Take care to call resolveInheritedNamespaceDecls. * after all namespace declarations have been added. * * @param nsSupport non-null reference to NamespaceSupport from * the ContentHandler. * @param excludeXSLDecl true if XSLT namespaces should be ignored. * * @throws TransformerException */ public void setPrefixes(NamespaceSupport nsSupport, boolean excludeXSLDecl) throws TransformerException { Enumeration decls = nsSupport.getDeclaredPrefixes(); while (decls.hasMoreElements()) { String prefix = (String) decls.nextElement(); if (null == m_declaredPrefixes) m_declaredPrefixes = new ArrayList(); String uri = nsSupport.getURI(prefix); if (excludeXSLDecl && uri.equals(Constants.S_XSLNAMESPACEURL)) continue; // System.out.println("setPrefixes - "+prefix+", "+uri); XMLNSDecl decl = new XMLNSDecl(prefix, uri, false); m_declaredPrefixes.add(decl); } }