Examples of XmlParser


Examples of org.apache.etch.util.core.xml.XmlParser

  public Message startMessage() throws IOException
  {
    stack.clear();
   
    TagElement te = new XmlParser().parseOne( rdr, null, MESSAGE_TAG );
    stack.push( te );
    elementList.push( te.getChildren() );
   
    Integer id = te.getIntAttr( null, STRUCT_TYPE_ATTR );
    Type type = vf.getType( id );
View Full Code Here

Examples of org.apache.struts.tiles.xmlDefinition.XmlParser

            InputStream input = servletContext.getResourceAsStream(filename);
            if (input == null) {
                return xmlDefinitions;
            }

            xmlParser = new XmlParser();

            // Check if definition set already exist.
            if (xmlDefinitions == null) {
                xmlDefinitions = new XmlDefinitionsSet();
            }
View Full Code Here

Examples of org.apache.tika.parser.xml.XMLParser

    public void parse(
            InputStream stream, ContentHandler handler, Metadata metadata)
            throws IOException, SAXException, TikaException {
        Document xmlDoc = parse(stream);
        XMLParser xp = new XMLParser();
        xp.getAllDocumentNs(xmlDoc);
        xp.extractContent(xmlDoc, Metadata.TITLE, "//dc:title", metadata);
        xp.extractContent(xmlDoc, Metadata.SUBJECT, "//dc:subject", metadata);
        xp.extractContent(xmlDoc, Metadata.CREATOR, "//dc:creator", metadata);
        xp.extractContent(xmlDoc, Metadata.DESCRIPTION, "//dc:description", metadata);
        xp.extractContent(xmlDoc, Metadata.LANGUAGE, "//dc:language", metadata);
        xp.extractContent(xmlDoc, Metadata.KEYWORDS, "//meta:keyword", metadata);
        xp.extractContent(xmlDoc, Metadata.DATE, "//dc:date", metadata);
        xp.extractContent(xmlDoc, "nbTab", "//meta:document-statistic/@meta:table-count", metadata);
        xp.extractContent(xmlDoc, "nbObject", "//meta:document-statistic/@meta:object-count", metadata);
        xp.extractContent(xmlDoc, "nbImg", "//meta:document-statistic/@meta:image-count", metadata);
        xp.extractContent(xmlDoc, "nbPage", "//meta:document-statistic/@meta:page-count", metadata);
        xp.extractContent(xmlDoc, "nbPara", "//meta:document-statistic/@meta:paragraph-count", metadata);
        xp.extractContent(xmlDoc, "nbWord", "//meta:document-statistic/@meta:word-count", metadata);
        xp.extractContent(xmlDoc, "nbcharacter", "//meta:document-statistic/@meta:character-count", metadata);

        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();
        xhtml.startElement("p");
        xp.concatOccurrence(xmlDoc, "//*", " ", new AppendableAdaptor(xhtml));
        xhtml.endElement("p");
        xhtml.endDocument();
    }
View Full Code Here

Examples of org.apache.tomcat.util.XMLParser

  } else {
      this.factory = factory;
  }

  try {
      config = (new XMLParser()).process(inputStream, validate);
  } catch (Exception e) {
      String msg = "can't read config: " + e.getMessage();

      throw new IllegalStateException(msg);
  }
View Full Code Here

Examples of org.apache.tomcat.util.XMLParser

  throws IOException, SAXParseException, SAXException {

  reset();

  // Parse the input stream into an XMLTree
  XMLParser parser = new XMLParser();
  XMLTree config = parser.process(stream);
  if (!config.getName().equals(Constants.Element.TOMCAT_USERS))
      return;
  Enumeration e;

  // Process the defined users
View Full Code Here

Examples of org.apache.tomcat.util.XMLParser

  }

  System.out.println(sm.getString("startup.loadconfig.msg",
            configURL));

  XMLParser parser = new XMLParser();

  try {
      this.config = parser.process(configURL, validate);
  } catch (Exception e) {
      throw new StartupException(e.getMessage());
  }

        processArgs(this.config);
View Full Code Here

Examples of org.apache.tomcat.util.XMLParser

     *
     */

    public void loadConfig(InputStream is, boolean validate)
    throws StartupException {
        XMLParser parser = new XMLParser();

  try {
      this.config = parser.process(is, validate);
  } catch (Exception e) {
      throw new StartupException(e.getMessage());
  }

  processArgs(this.config);
View Full Code Here

Examples of org.apache.tomcat.util.XMLParser

  }

  System.out.println(sm.getString("startup.loadconfig.msg",
            configURL));

  XMLParser parser = new XMLParser();

  try {
      this.config = parser.process(configURL, validate);
  } catch (Exception e) {
      throw new StartupException(e.getMessage());
  }

        processArgs(this.config);
View Full Code Here

Examples of org.apache.tomcat.util.XMLParser

     *
     */

    public void loadConfig(InputStream is, boolean validate)
    throws StartupException {
        XMLParser parser = new XMLParser();

  try {
      this.config = parser.process(is, validate);
  } catch (Exception e) {
      throw new StartupException(e.getMessage());
  }

  processArgs(this.config);
View Full Code Here

Examples of org.apache.uima.util.XMLParser

      Document apple2xmlDoc = docBuilder.parse(new ByteArrayInputStream(apple2xml.getBytes()));
      Document orangeXmlDoc = docBuilder.parse(new ByteArrayInputStream(orangeXml.getBytes()));
      Document fruitBagXmlDoc = docBuilder.parse(new ByteArrayInputStream(fruitBagXml.getBytes()));

      // construct new objects from the XML
      XMLParser xmlp = UIMAFramework.getXMLParser();
      MetaDataObject_impl newApple1 = (MetaDataObject_impl) unknownFruit.clone();
      newApple1.buildFromXMLElement(apple1xmlDoc.getDocumentElement(), xmlp);
      MetaDataObject_impl newApple2 = (MetaDataObject_impl) unknownFruit.clone();
      newApple2.buildFromXMLElement(apple2xmlDoc.getDocumentElement(), xmlp);
      MetaDataObject_impl newOrange = (MetaDataObject_impl) unknownFruit.clone();
      newOrange.buildFromXMLElement(orangeXmlDoc.getDocumentElement(), xmlp);

      xmlp.addMapping("fruit", TestFruitObject.class.getName());

      MetaDataObject_impl newFruitBag = new TestFruitBagObject();
      newFruitBag.buildFromXMLElement(fruitBagXmlDoc.getDocumentElement(), xmlp);

      // new objects should be equal to the originals
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.