Examples of XmlParser


Examples of org.eclipse.persistence.platform.xml.XMLParser

                    if (m_classLoader != null) {
                      p.getDatasourceLogin().getDatasourcePlatform().getConversionManager().
                        setLoader(m_classLoader);
                    }
                    XMLPlatform xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform();
                    XMLParser parser = xmlPlatform.newXMLParser();
                    parser.setNamespaceAware(true);
                    parser.setWhitespacePreserving(false);
                  XMLContext context = new XMLContext(p);
                  context.getSession(Project.class).getEventManager().addListener(
                    new MissingDescriptorListener());
                  XMLUnmarshaller unmarshaller = context.createUnmarshaller();
                  project = (Project)unmarshaller.unmarshal(url);
View Full Code Here

Examples of org.h2.build.doc.XMLParser

    private void addResource(String key, Doc doc) {
        if (!isResource(doc)) {
            return;
        }
        String xhtml = doc.commentText();
        XMLParser p = new XMLParser(xhtml);
        StringBuilder buff = new StringBuilder();
        int column = 0;
        int firstColumnSize = 0;
        boolean inColumn = false;
        while (p.hasNext()) {
            String s;
            switch(p.next()) {
            case XMLParser.END_ELEMENT:
                s = p.getName();
                if ("p".equals(s) || "tr".equals(s) || "br".equals(s)) {
                    buff.append('\n');
                }
                break;
            case XMLParser.START_ELEMENT:
                s = p.getName();
                if ("table".equals(s)) {
                    buff.append('\n');
                } else if ("tr".equals(s)) {
                    column = 0;
                } else if ("td".equals(s)) {
                    inColumn = true;
                    column++;
                    if (column == 2) {
                        buff.append('\t');
                    }
                }
                break;
            case XMLParser.CHARACTERS:
                s = HtmlConverter.convertHtmlToString(p.getText().trim());
                if (inColumn && column == 1) {
                    firstColumnSize = Math.max(s.length(), firstColumnSize);
                }
                buff.append(s);
                break;
View Full Code Here

Examples of org.hibernate.jpamodelgen.xml.XmlParser

      context.logMessage( Diagnostic.Kind.OTHER, "Finished processing" );
      return ALLOW_OTHER_PROCESSORS_TO_CLAIM_ANNOTATIONS;
    }

    if ( !xmlProcessed ) {
      XmlParser parser = new XmlParser( context );
      parser.parsePersistenceXml();
      xmlProcessed = true;
    }

    if ( !hostJPAAnnotations( annotations ) ) {
      context.logMessage( Diagnostic.Kind.OTHER, "Current processing round does not contain entities" );
View Full Code Here

Examples of org.jboss.blacktie.jatmibroker.core.conf.XMLParser

  public CommandHandler() throws ConfigurationException,
      MalformedObjectNameException, NullPointerException {
    // Obtain the JMXURL from the btconfig.xml
    XMLEnvHandler handler = new XMLEnvHandler(prop);
    XMLParser xmlenv;
    xmlenv = new XMLParser(handler, "btconfig.xsd");
    xmlenv.parse("btconfig.xml");
    url = (String) prop.get("JMXURL");
    if (url == null) {
      throw new ConfigurationException(
          "No JMX url configuration in btconfig.xml");
    }
View Full Code Here

Examples of org.jboss.errai.forge.xml.XmlParser

  @Override
  public boolean install() {
    try {
      final File file = getResFile(getRelPath());

      final XmlParser xmlParser = xmlParserFactory.newXmlParser(file);

      final XPath xPath = xPathFactory.newXPath();
      final Map<XPathExpression, Collection<Node>> toInsert = getElementsToInsert(xPath, xmlParser);
      final Map<XPathExpression, Node> replacements = getReplacements(xPath, xmlParser);

      for (final Entry<XPathExpression, Collection<Node>> entry : toInsert.entrySet()) {
        xmlParser.addChildNodes(entry.getKey(), entry.getValue());
      }

      for (final Entry<XPathExpression, Node> entry : replacements.entrySet()) {
        xmlParser.replaceNode(entry.getKey(), entry.getValue());
      }

      xmlParser.close();
    }
    catch (Exception e) {
      error("Error: failed to add required inheritance to module.", e);
      return false;
    }
View Full Code Here

Examples of org.jclouds.xml.XMLParser

    *            If there is an error during serialization.
    */
   public static void assertPayloadEquals(final Payload payload, final String expected,
         final Class<? extends SingleResourceTransportDto> entityClass) throws IOException {
      // Serialize and deserialize to avoid formatting issues
      XMLParser xml = new JAXBParser("false");
      SingleResourceTransportDto entity = xml.fromXML(expected, entityClass);
      String toMatch = xml.toXML(entity, entityClass);

      assertEquals(payload.getRawContent(), toMatch);
   }
View Full Code Here

Examples of org.kxml.parser.XmlParser

                    + c1.latitude + "," + c1.longitude + "," + c2.latitude + "," + c2.longitude + "/"
                    + ROUTING_OPTIONS.get(Options.getInstance().routeType) + "?units=km&lang=en");
            if (Options.getInstance().debugMode) {
                System.out.println(routeGpx);
            }
            XmlParser parser = new XmlParser(new InputStreamReader(new ByteArrayInputStream(routeGpx.getBytes())));
            Document doc = new Document();
            doc.parse(parser);
            parser = null;
            Element root = doc.getRootElement();
            Route result = new Route();
View Full Code Here

Examples of org.mortbay.xml.XmlParser

            parent=true;
           
        }
       
        // Create a TLD parser
        XmlParser parser = new XmlParser(false);
        parser.redirectEntity("web-jsptaglib_1_1.dtd",Loader.getResource(TagLibConfiguration.class,"javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd", false));
        parser.redirectEntity("web-jsptaglib_1_2.dtd",Loader.getResource(TagLibConfiguration.class,"javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd", false));
        parser.redirectEntity("web-jsptaglib_2_0.xsd",Loader.getResource(TagLibConfiguration.class,"javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd", false));
        parser.redirectEntity("web-jsptaglibrary_1_1.dtd",Loader.getResource(TagLibConfiguration.class,"javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd", false));
        parser.redirectEntity("web-jsptaglibrary_1_2.dtd",Loader.getResource(TagLibConfiguration.class,"javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd", false));
        parser.redirectEntity("web-jsptaglibrary_2_0.xsd",Loader.getResource(TagLibConfiguration.class,"javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd", false));
        parser.setXpath("/taglib/listener/listener-class");
        // Parse all the discovered TLDs
        Iterator iter = tlds.iterator();
        while (iter.hasNext())
        {
            try
            {
                Resource tld = (Resource)iter.next();
                if (Log.isDebugEnabled()) Log.debug("TLD="+tld);
               
                XmlParser.Node root;
               
                try
                {
                    //xerces on apple appears to sometimes close the zip file instead
                    //of the inputstream, so try opening the input stream, but if
                    //that doesn't work, fallback to opening a new url
                    root = parser.parse(tld.getInputStream());
                }
                catch (Exception e)
                {
                    root = parser.parse(tld.getURL().toString());
                }

    if (root==null)
    {
        Log.warn("No TLD root in {}",tld);
View Full Code Here

Examples of org.newdawn.slick.util.xml.XMLParser

   *
   * @param argv The arguments given to the test
   * @throws SlickException Indicates a failure
   */
  public static void main(String[] argv) throws SlickException {
    XMLParser parser = new XMLParser();
   
    XMLElement root = parser.parse("testdata/test.xml");
   
    assertEquals(root.getName(), "testRoot");
    System.out.println(root);
    assertNotNull(root.getChildrenByName("simple").get(0).getContent());
    System.out.println(root.getChildrenByName("simple").get(0).getContent());
View Full Code Here

Examples of org.olat.core.util.xml.XMLParser

    BufferedInputStream bis = null;
    Document doc = null;
    try {
      in = new FileInputStream(documentF);
      bis = new BufferedInputStream(in);
      XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
      doc = xmlParser.parse(bis, false);
    }
    catch (IOException e) {
      throw new OLATRuntimeException(ScormCPManifestTreeModel.class, "could not read and parse from file "+documentF.getAbsolutePath(),e);
    }
    finally {
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.