Creates a namespace aware document builder.

@return New instance.
7433
@NotNull
    public static DocumentBuilder createDocumentBuilder() {
        try {
            final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
            factory.setNamespaceAware(true);
            return factory.newDocumentBuilder();
        } catch (final ParserConfigurationException ex) {
            throw new RuntimeException("Couldn't create document builder", ex);
        }
    }
973861
private DocumentBuilder getDocumentBuilderFromPool()
            throws ParserConfigurationException {
        DocumentBuilder builder = documentBuilderPool.pollFirst();
        if (builder == null){
            builder = getDomFactory().newDocumentBuilder();
        }
        builder.setErrorHandler(errorHandler);
        return builder;
    }
4793
@Nonnull
  public static DocumentBuilderFactory createDefaultDocumentBuilderFactory ()
  {
    final DocumentBuilderFactory aDocumentBuilderFactory = DocumentBuilderFactory.newInstance ();
    aDocumentBuilderFactory.setNamespaceAware (DEFAULT_DOM_NAMESPACE_AWARE);
    aDocumentBuilderFactory.setValidating (DEFAULT_DOM_VALIDATING);
    aDocumentBuilderFactory.setIgnoringElementContentWhitespace (DEFAULT_DOM_IGNORING_ELEMENT_CONTENT_WHITESPACE);
    aDocumentBuilderFactory.setExpandEntityReferences (DEFAULT_DOM_EXPAND_ENTITY_REFERENCES);
    aDocumentBuilderFactory.setIgnoringComments (DEFAULT_DOM_IGNORING_COMMENTS);
    aDocumentBuilderFactory.setCoalescing (DEFAULT_DOM_COALESCING);
    try
    {
      // Set secure processing to be the default. This is anyway the default in
      // JDK8
      aDocumentBuilderFactory.setFeature (EXMLParserFeature.SECURE_PROCESSING.getName (), true);
    }
    catch (final ParserConfigurationException ex1)
    {
      // Ignore
    }
    try
    {
      aDocumentBuilderFactory.setXIncludeAware (DEFAULT_DOM_XINCLUDE_AWARE);
    }
    catch (final UnsupportedOperationException ex)
    {
      // Ignore
    }
    return aDocumentBuilderFactory;
  }
805523
public static Map<String, String> getNamespaceMapping(final Document document) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("xmlns", "http://www.w3.org/2000/xmlns/");
        map.put("xml", "http://www.w3.org/XML/1998/namespace");
//      if (childName.equals("xmlns") || childName.startsWith("xmlns:")) {
//      return "http://www.w3.org/2000/xmlns/";
//  }
//  if (childName.startsWith("xml:")) {
//      return "http://www.w3.org/XML/1998/namespace";
//  }

        Element root = document.getDocumentElement();
        if (root == null) {
            // No document, no namespaces.
            return map;
        }

        fillNSMapWithPrefixesDeclaredInElement(map, root);
        return map;
    }
1108490
public static Document newDocument() throws AlipayApiException {
        Document doc = null;

        try {
            doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        } catch (ParserConfigurationException e) {
            throw new AlipayApiException(e);
        }

        return doc;
    }
86341
public static NamespaceContext createNamespaceContext() {
    return new NamespaceContext() {
      private HashMap<String, String> namespaces = new HashMap<String, String>(1);

      {
        namespaces.put(DEFAULT_NAMESPACE_PREFIX, DEFAULT_NAMESPACE_URI);
      }

      public String getNamespaceURI(String prefix) {
        if (namespaces.isEmpty() || StringUtil.isNullOrEmpty(prefix) || !namespaces.containsKey(prefix))
          return StringUtil.empty;
        return namespaces.get(prefix);
      }

      public Iterator getPrefixes(String namespaceURI) {
        return namespaces.values().iterator();
      }

      public String getPrefix(String namespaceURI) {
        if (StringUtil.isNullOrEmpty(namespaceURI))
          return StringUtil.empty;

        for(Entry<String, String> entry : namespaces.entrySet())
          if (namespaceURI.equals(entry.getValue()))
            return entry.getKey();

        return StringUtil.empty;
      }
    };
  }
546723
static DocumentBuilderFactory getDBF() {
        DocumentBuilderFactory dbf = threadDBF.get();
        if (dbf == null) {
            dbf = DocumentBuilderFactory.newInstance();
            dbf.setNamespaceAware(true);
            threadDBF.set(dbf);
        }
        return dbf;
    }
1308344
public function CreatePage() 
	{		
		$myWords = $this->WordCollection();		

		$this->_titlePage = $myWords->Value("TITLE", $this->_context->get("SERVER_NAME") );
		$this->_abstractPage = $myWords->Value("ABSTRACT", $this->_context->get("SERVER_NAME") );
		
		$this->_document = new XmlnukeDocument($this->_titlePage, $this->_abstractPage);
		
		$this->txtSearch = $this->_context->get("txtSearch");

		if ($this->txtSearch != "")
		{
			$this->Form();
			$doc = $this->Find();
		}
		else
		{
			$this->Form();
		}
		return $this->_document->generatePage();
	}
1004526
public static Document createDomDocument() throws Exception
	{
	    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	    factory.setNamespaceAware(true);
	    DocumentBuilder builder = factory.newDocumentBuilder();

	    return builder.newDocument();
	}
538787
static XMLName create(String defaultNamespaceUri, String name) {
        if (name == null)
            throw new IllegalArgumentException();

        int l = name.length();
        if (l != 0) {
            char firstChar = name.charAt(0);
            if (firstChar == '*') {
                if (l == 1) {
                    return XMLName.formStar();
                }
            } else if (firstChar == '@') {
                XMLName xmlName = XMLName.formProperty("", name.substring(1));
                xmlName.setAttributeName();
                return xmlName;
            }
        }

        return XMLName.formProperty(defaultNamespaceUri, name);
    }
1368790
public InternalDocumentRevision build() {
        DocumentRevisionOptions options = new DocumentRevisionOptions();
        options.sequence = sequence;
        options.docInternalId = docInternalId;
        options.deleted = deleted;
        options.current = current;
        options.parent = parent;
        options.attachments = attachments;
        return new InternalDocumentRevision(docId, revId, body, options);
    }
91663
public static DocumentBuilder newDocumentBuilder(boolean nsAware, boolean validating) throws ParserConfigurationException{
        return newDocumentBuilder(nsAware, validating, false, false);
    }
305311
static void initBuilder() {
		try {
			DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
			docBuilderFactory.setNamespaceAware(true);
			docBuilder = docBuilderFactory.newDocumentBuilder();
		} catch (ParserConfigurationException ex) {
			throw new RuntimeException(ex);
		}
	}
1340785
public T namespaces(Map<String, String> namespaceMappings) {
        getXpathVariableExtractor().getNamespaces().putAll(namespaceMappings);

        xmlMessageValidationContext.getNamespaces().putAll(namespaceMappings);
        return self;
    }
1360401
@Override
    public void createNamespace() {
        // Use a temporary, no-keyspace session
        try (DBConn dbConn = createAndConnectConn(null)) {
            synchronized (m_schemaLock) {
                if (!m_schemaMgr.keyspaceExists(dbConn, m_keyspace)) {
                    m_schemaMgr.createKeyspace(dbConn, m_keyspace);
                }
            }
        }
    }
982597
public static XMLInputFactory createSafeXmlInputFactory() {
    XMLInputFactory xif = XMLInputFactory.newInstance();
    if (xif.isPropertySupported(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES)) {
      xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES,
                      false);
    }

    if (xif.isPropertySupported(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)) {
      xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES,
                      false);
    }

    if (xif.isPropertySupported(XMLInputFactory.SUPPORT_DTD)) {
      xif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
    }
    return xif;
  }
1139339
static public ContentHandleFactory newFactory() {
    return new ContentHandleFactory() {
      @Override
      public Class<?>[] getHandledClasses() {
        return new Class<?>[]{ XMLEventReader.class };
      }
      @Override
      public boolean isHandled(Class<?> type) {
        return XMLEventReader.class.isAssignableFrom(type);
      }
      @Override
      public <C> ContentHandle<C> newHandle(Class<C> type) {
        @SuppressWarnings("unchecked")
        ContentHandle<C> handle = isHandled(type) ?
                                  (ContentHandle<C>) new XMLEventReaderHandle() : null;
        return handle;
      }
    };
  }