Announcement Announcement Module
Collapse
No announcement yet.
XInclude and XmlBeanFactory Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XInclude and XmlBeanFactory

    Does XmlBeanFactory support any type of file inclusion, such as XInclude to allow the beans file to be broken out into multiple layers of bean xml files? Or, would it be necessary to manually use XInclude to generate a temporary file (or stream resource) and then use XmlBeanFactory to load that?

    Basically, i'd like to load a beans.xml file from my applicatoin jar, and include other .xml files via this mechanism.

    Any thoughts?

  • #2
    Spring 1.1.1 added "import" element for XML beans definitions to allow for loading further bean definitions from relative paths.
    Originally posted by spring-beans.dtd
    <!--
    Specifies an XML bean definition resource to import.
    -->
    <!ELEMENT import EMPTY>

    <!--
    The relative resource location of the XML bean definition file to import,
    for example "myImport.xml" or "includes/myImport.xml" or "../myImport.xml".
    -->
    <!ATTLIST import resource CDATA #IMPLIED>
    You can also use ApplicationContext which allow using multiple XML files for beans definitions. You can mix files from the filesystem and the classpath.

    HTH

    Comment

    Working...
    X