Package org.eclipse.jetty.xml

Examples of org.eclipse.jetty.xml.XmlParser


   
    public XmlParser newParser()
    throws ClassNotFoundException
    {
        XmlParser xmlParser = new WebDescriptor(null).newParser();
       
        URL jsp21xsd = Loader.getResource(Servlet.class, "javax/servlet/resources/jsp_2_1.xsd", true);
        redirect(xmlParser,"jsp_2_1.xsd",jsp21xsd);
       
        //set up cache of DTDs and schemas locally       
View Full Code Here


  }
 
  @Test
  public void testXml() throws Exception
  {
    XmlParser parser = getParser(true);
    try
    {
      parser.parse(getClass().getResource("/org/cipango/xml/sip.xml").toString());
      fail("expected SAXParseException");
    }
    catch (SAXParseException e)
    {
    }
   
    parser = getParser(false);
    parser.parse(getClass().getResource("/org/cipango/xml/sip.xml").toString());
  }
View Full Code Here

  }

  @Test
  public void testXmlDtd() throws Exception
  {
    XmlParser parser = getParser(true);
    parser.parse(getClass().getResource("/org/cipango/xml/sip-dtd.xml").toString());
  }
View Full Code Here

  @Test
  public void testXmlXsd() throws Exception
  {
    //System.out.println(WebAppContext.class.getResource("/javax/servlet/resources/javaee_5.xsd"));
    XmlParser parser = getParser(true);
    parser.parse(getClass().getResource("/org/cipango/xml/sip-xsd.xml").toString());
  }
View Full Code Here

  }

  @Test
  public void testWeb() throws Exception
  {
    XmlParser parser = getParser(true);
    parser.parse(getClass().getResource("/org/cipango/xml/web.xml").toString());
  }
View Full Code Here

            _parser = newParser(isValidating());
    }

    public static XmlParser newParser(boolean validating) throws ClassNotFoundException
    {
        XmlParser xmlParser=new XmlParser(validating)
        {
            boolean mapped=false;
           
            @Override
            protected InputSource resolveEntity(String pid, String sid)
View Full Code Here

        @Override
        public XmlParser newParser() throws ClassNotFoundException
        {
            // Create a TLD parser
            XmlParser parser = new XmlParser(false);

            URL taglib11=null;
            URL taglib12=null;
            URL taglib20=null;
            URL taglib21=null;

            try
            {
                Class<?> jsp_page = Loader.loadClass(WebXmlConfiguration.class,"javax.servlet.jsp.JspPage");
                taglib11=jsp_page.getResource("javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd");
                taglib12=jsp_page.getResource("javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd");
                taglib20=jsp_page.getResource("javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd");
                taglib21=jsp_page.getResource("javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd");
            }
            catch(Exception e)
            {
                LOG.ignore(e);
            }
            finally
            {
                if(taglib11==null)
                    taglib11=Loader.getResource(Servlet.class,"javax/servlet/jsp/resources/web-jsptaglibrary_1_1.dtd");
                if(taglib12==null)
                    taglib12=Loader.getResource(Servlet.class,"javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd");
                if(taglib20==null)
                    taglib20=Loader.getResource(Servlet.class,"javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd");
                if(taglib21==null)
                    taglib21=Loader.getResource(Servlet.class,"javax/servlet/jsp/resources/web-jsptaglibrary_2_1.xsd");
            }


            if(taglib11!=null)
            {
                redirect(parser, "web-jsptaglib_1_1.dtd",taglib11);
                redirect(parser, "web-jsptaglibrary_1_1.dtd",taglib11);
            }
            if(taglib12!=null)
            {
                redirect(parser, "web-jsptaglib_1_2.dtd",taglib12);
                redirect(parser, "web-jsptaglibrary_1_2.dtd",taglib12);
            }
            if(taglib20!=null)
            {
                redirect(parser, "web-jsptaglib_2_0.xsd",taglib20);
                redirect(parser, "web-jsptaglibrary_2_0.xsd",taglib20);
            }
            if(taglib21!=null)
            {
                redirect(parser, "web-jsptaglib_2_1.xsd",taglib21);
                redirect(parser, "web-jsptaglibrary_2_1.xsd",taglib21);
            }

            parser.setXpath("/taglib/listener/listener-class");
            return parser;
        }
View Full Code Here

    }

    public XmlParser newParser()
    throws ClassNotFoundException
    {
        XmlParser xmlParser=new XmlParser()
        {
            boolean mapped=false;
           
            @Override
            protected InputSource resolveEntity(String pid, String sid)
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.xml.XmlParser

Copyright © 2018 www.massapicom. 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.