You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by gr...@kodak.com on 2005/04/14 21:57:23 UTC
[Configuration] Validation using XML Schema
I'm using Commons Configuration to manage my xml configuration files. Is
there a way to validate the xml configuration files I have listed in my
config.xml file according to an XML Schema?
Source code:
ConfigurationFactory factory = null;
try{
factory = new ConfigurationFactory();
}
URL configURL = getClass().getResource(xISConfigURL);
factory.setConfigurationURL(configURL);
try
{
compositeConfiguration = (CompositeConfiguration)
factory.getConfiguration();
}
catch (ConfigurationException e)
{
}
globalXisConfig = (HierarchicalXMLConfiguration)
compositeConfiguration.getConfiguration(0);
I am using Configuration Version: commons-configuration-1.0-rc2
Thanks in advance for your help,
Greg Gray
Re: [Configuration] Validation using XML Schema
Posted by Oliver Heger <he...@med.uni-marburg.de>.
Validation of XML documents (XML Schema or DTD) is not yet supported.
There is already an enhancement request for DTD validation in our bug
tracking system:
http://issues.apache.org/bugzilla/show_bug.cgi?id=31616
but I don't know when we come to implement this feature.
Oliver
greg.gray@kodak.com wrote:
> I'm using Commons Configuration to manage my xml configuration files. Is
> there a way to validate the xml configuration files I have listed in my
> config.xml file according to an XML Schema?
>
> Source code:
>
> ConfigurationFactory factory = null;
> try{
> factory = new ConfigurationFactory();
> }
>
> URL configURL = getClass().getResource(xISConfigURL);
>
> factory.setConfigurationURL(configURL);
>
> try
> {
> compositeConfiguration = (CompositeConfiguration)
> factory.getConfiguration();
> }
> catch (ConfigurationException e)
> {
> }
>
> globalXisConfig = (HierarchicalXMLConfiguration)
> compositeConfiguration.getConfiguration(0);
>
>
> I am using Configuration Version: commons-configuration-1.0-rc2
>
>
> Thanks in advance for your help,
>
> Greg Gray
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org