You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Steve Brewin <sb...@synsys.com> on 2003/06/20 15:15:44 UTC

XML Entities in config.xml

Hi,

Has anyone had any success bringing XML entities into James' config.xml
using something like this...

<?xml version="1.0"?>
<!DOCTYPE config [<!ENTITY testScript SYSTEM "./testScript.xml">]>
<config>
   &testScript;
</config>

Xerces is throwing a MalformedURLException saying that "./testScript.xml"
lacks a protocol. True, but irrelevant. The XML spec. says that this is
valid.

Of course, I should also check the Xerces user archives, but they are down
at the moment.

Ideas anyone?

-- Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: XML Entities in config.xml

Posted by "Noel J. Bergman" <no...@devtech.com>.
Steve,

  <?xml version="1.0"?>
  <!DOCTYPE config [<!ENTITY testScript
                      SYSTEM "file:../apps/james/SAR-INF/testScript.xml">]>
  <config>
    &testScript;
  </config>

Although I like the approach that you appear to be taking, you might want to
consider that Avalon keeps the XML parser and all generated objects
in-memory for the lifetime of the application.  I haven't looked in their
code to see why; I am basing this upon what I see when using the heap
profiler.

If we are going to expand the size of config.xml, which your approach would
potentially explode, then we should try to get more memory efficient
handling from Avalon.

Another thing to consider is reconfiguration.  This approach would appear to
require reloading the entire configuration to change a script, at least with
a simplistic implementation.

By the way, is that file url being interpreted relative to the phoenix bin,
as implied by your example?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org


RE: XML Entities in config.xml

Posted by Steve Brewin <sb...@synsys.com>.
> Has anyone had any success bringing XML entities into James'
> config.xml
> using something like this...
>
> <?xml version="1.0"?>
> <!DOCTYPE config [<!ENTITY testScript SYSTEM "./testScript.xml">]>
> <config>
>    &testScript;
> </config>
>
Solved it! Works with the following...

<?xml version="1.0"?>
<!DOCTYPE config [<!ENTITY testScript SYSTEM
"file:../apps/james/SAR-INF/testScript.xml">]>
<config>
   &testScript;
</config>

The XML specs. don't mention "file:", but hey.

-- Steve


---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org