Examples of DocumentBuilderFactory


Examples of com.dotcms.repackage.javax.xml.parsers.DocumentBuilderFactory

    try {
      VelocityEngine ve = VelocityUtil.getEngine();
      ve.getTemplate("/" + location + "/" + pageIdent + "." + VELOCITY_HTMLPAGE_EXTENSION).merge(context, sw);
      ITextRenderer renderer = new ITextRenderer();
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      documentBuilderFactory.setValidating(false);
      DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder();
      builder.setEntityResolver(new DTDResolver());
      String s = sw.toString();
      s = escapeEspecialCharacter(s);

      s = processCSSPath(s, host, "css", "\\(", "\\)", ")", url);
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

  protected static Node getNode(String text) throws Exception {
    Node ret=null;
   
    try {
      // Transform the text representation to DOM
      DocumentBuilderFactory fact=DocumentBuilderFactory.newInstance();
      fact.setNamespaceAware(true);
     
      DocumentBuilder builder=fact.newDocumentBuilder();
     
      // Check if XML document, and if not return as text node
      if (text.trim().length() == 0 || text.charAt(0) != '<') {
        org.w3c.dom.Document doc=builder.newDocument();
       
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

        expected = null;
        XMLAssert.assertXMLEqual(expectedDoc, actualDoc);
    }

    private static Document buildDocument(InputStream is) {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        final Document doc;
        try {
            DocumentBuilder db = dbf.newDocumentBuilder();
            doc = db.parse(is);
        } catch (Exception e) {
            throw new IllegalStateException("buildDocument failed!", e);
        }
        return doc;
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

    Document returnDocument = null;
    try
    {

      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
      factory.setValidating(true);
      DocumentBuilder builder = factory.newDocumentBuilder();

      ErrorHandler errorHandler = new ErrorHandler() {

        public void warning(org.xml.sax.SAXParseException e)
        {
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

    /* Not thread safe. Calling method must ensure all calls to this method are synchronized. */
    private byte[] adaptWsdl(HttpServletRequest req, String locationBase) throws IOException, WsException {
        Document doc;
        try {
            // read the schema to DOM representation
            DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
            fact.setNamespaceAware(true);
            DocumentBuilder bldr = fact.newDocumentBuilder();
            doc = bldr.parse(m_wsdlProvider.getWSDL(req));
            Element schema = doc.getDocumentElement();
            NodeList services = schema.getElementsByTagNameNS(WSDLSOAP_NAMESPACE, "address");
            for (int i = 0; i < services.getLength(); i++) {
                Node node = services.item(i).getAttributes().getNamedItem("location");
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

    /**
     * Returns a DOM parser
     */
    public static DocumentBuilder newDocumentBuilder()
            throws ParserConfigurationException {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setValidating(false);
        factory.setNamespaceAware(false);
        DocumentBuilder builder = factory.newDocumentBuilder();

        return builder;
    }
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

        settings.setStartDate(new DateTime(2009, 6, 1, 8, 0, 0, 0));
    }

    public List<JavaOneInterval> parse(InputStream is) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setValidating(false);
        factory.setNamespaceAware(false);
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse(is);
        return parse(doc);
    }
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

      }
    } else if (sourceClass == SAXSource.class) {
      return (T) new SAXSource(new InputSource(getBinaryStream()));
    } else if (sourceClass == DOMSource.class) {
      try {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        dbf.setNamespaceAware(true);
        DocumentBuilder docBuilder = dbf.newDocumentBuilder();
              Node doc = docBuilder.parse(new InputSource(getBinaryStream()));
              return (T) new DOMSource(doc);
      } catch (ParserConfigurationException e) {
        throw new SQLException(e);
      } catch (SAXException e) {
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

    /**
     * <p>Load mapping definition from XML Document object. </p>
     */
    public MappingDocument loadDocument(InputStream stream) throws MappingException {
        try {
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
            dbf.setValidating(false);
            DocumentBuilder db = dbf.newDocumentBuilder();
            Document doc = db.parse(stream);
            return loadContents(doc);
        } catch (IOException e) {
            throw new MappingException(e);
        } catch (ParserConfigurationException e) {
View Full Code Here

Examples of javax.xml.parsers.DocumentBuilderFactory

    }
    return file;
  }
 
  private Document loadXmlFrom(InputStream is) throws SAXException, IOException {
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    DocumentBuilder builder = null;
    try {
      builder = factory.newDocumentBuilder();
    } catch (ParserConfigurationException ex) { }
    return builder.parse(is);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.