/** Ensures that the namespace from the QName is stored with the blob. */ private void ensureBlobNamespace(ElementHandler handler, String qName) { // Get the namespace. NamespaceDecl nsDecl = null; String alias = qName.substring(0, Math.max(0, qName.indexOf(":"))); if (alias.equals("xml")) { // "xml:" doesn't need a declaration. return; } Stack<NamespaceDecl> mapping = namespaceMap.get(alias); if (mapping != null) { nsDecl = mapping.peek(); } // The namespace might be null for a namespace-less element. assert alias.length() == 0 || nsDecl != null : "Namespace alias '" + alias + "' should be mapped in 'namespaceMap'."; // Make sure the namespace is described within the blob if it was // originally declared externally to it if (nsDecl != null && !nsDecl.inBlob && nsDecl.ns != null && !handler.blobNamespaces.contains(alias)) { handler.blobNamespaces.add(alias); handler.xmlBlob.getNamespaces().add( new XmlNamespace(alias, nsDecl.ns.getUri())); } }
/** Ensures that the namespace from the QName is stored with the blob. */ private void ensureBlobNamespace(ElementHandler handler, String qName) { // Get the namespace. NamespaceDecl nsDecl = null; String alias = qName.substring(0, Math.max(0, qName.indexOf(":"))); if (alias.equals("xml")) { // "xml:" doesn't need a declaration. return; } Stack<NamespaceDecl> mapping = namespaceMap.get(alias); if (mapping != null) { nsDecl = mapping.peek(); } // The namespace might be null for a namespace-less element. assert alias.length() == 0 || nsDecl != null : "Namespace alias '" + alias + "' should be mapped in 'namespaceMap'."; // Make sure the namespace is described within the blob if it was // originally declared externally to it if (nsDecl != null && !nsDecl.inBlob && nsDecl.ns != null && !handler.blobNamespaces.contains(alias)) { handler.blobNamespaces.add(alias); handler.xmlBlob.getNamespaces().add( new XmlNamespace(alias, nsDecl.ns.getUri())); } }
/** Ensures that the namespace from the QName is stored with the blob. */ private void ensureBlobNamespace(ElementHandler handler, String qName) { // Get the namespace. NamespaceDecl nsDecl = null; String alias = qName.substring(0, Math.max(0, qName.indexOf(":"))); if (alias.equals("xml")) { // "xml:" doesn't need a declaration. return; } Stack<NamespaceDecl> mapping = namespaceMap.get(alias); if (mapping != null) { nsDecl = mapping.peek(); } // The namespace might be null for a namespace-less element. assert alias.length() == 0 || nsDecl != null : "Namespace alias '" + alias + "' should be mapped in 'namespaceMap'."; // Make sure the namespace is described within the blob if it was // originally declared externally to it if (nsDecl != null && !nsDecl.inBlob && nsDecl.ns != null && !handler.blobNamespaces.contains(alias)) { handler.blobNamespaces.add(alias); handler.xmlBlob.getNamespaces().add( new XmlNamespace(alias, nsDecl.ns.getUri())); } }
List<XmlNamespace> blobNamespaces = xml.getNamespaces(); int additionalNsSize = (additionalNs == null ? 0 : additionalNs.size());
List<XmlNamespace> blobNamespaces = xml.getNamespaces(); int additionalNsSize = (additionalNs == null ? 0 : additionalNs.size());
List<XmlNamespace> blobNamespaces = xml.getNamespaces(); int additionalNsSize = (additionalNs == null ? 0 : additionalNs.size());
Collection<XmlNamespace> namespaces = cumulative.getNamespaces(); cumulative.setLang(xmlBlob.getLang()); cumulative.setBase(xmlBlob.getBase()); namespaces.addAll(xmlBlob.getNamespaces()); w.write(xmlBlob.getBlob());
Collection<XmlNamespace> namespaces = cumulative.getNamespaces(); cumulative.setLang(xmlBlob.getLang()); cumulative.setBase(xmlBlob.getBase()); namespaces.addAll(xmlBlob.getNamespaces()); w.write(xmlBlob.getBlob());
Collection<XmlNamespace> namespaces = cumulative.getNamespaces(); cumulative.setLang(xmlBlob.getLang()); cumulative.setBase(xmlBlob.getBase()); namespaces.addAll(xmlBlob.getNamespaces()); w.write(xmlBlob.getBlob());