Announcement Announcement Module
Collapse
No announcement yet.
How to use the system id in the xml definition file? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use the system id in the xml definition file?

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <!--DOCTYPE beans SYSTEM "spring-beans.dtd"-->
    <beans>
    </beans>

    -------------------------------------
    I just want to use the system doctype instead of the public xml doc type in my intranet env in which I cannot connect the internet.But the spring xml parse code will broken if I do this.

    Can anyone help me?

  • #2
    How to use the system id in the xml definition file -Crimson

    Does this answer your question?

    http://opensource.atlassian.com/proj...browse/SPR-212

    Comment


    • #3
      Thanks.

      Thanks.

      Comment


      • #4
        It works.

        The only thing need to do is add the xerces jar lib to the classpath.But I wonder how the springframework know which parser to use?

        Comment


        • #5
          The xml doc builder factory load order.

          See the javadoc :

          Method DetailnewInstance public static DocumentBuilderFactory newInstance() throws FactoryConfiguration;

          -------------------------------------
          (1)Use the javax.xml.parsers.DocumentBuilderFactory system property. (2)Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above.
          (3)Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a classname in the file META-INF/services/javax.xml.parsers.DocumentBuilderFactory in jars available to the runtime.
          (4)Platform default DocumentBuilderFactory instance.

          Comment

          Working...
          X