You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by SwenVogel <sw...@ypsystems.de> on 2009/06/17 10:09:43 UTC

XML Validation with multiple XSLT schema files.

Hi,

how can i use the validation component when the source XML must be validated
against multiple XSLT schema files? For example it is quite common to use a
core schema and other additional schemas.

Thanks for your help ...
-- 
View this message in context: http://www.nabble.com/XML-Validation-with-multiple-XSLT-schema-files.-tp24068904p24068904.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: XML Validation with multiple XSLT schema files.

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I have created a ticket to track this
https://issues.apache.org/activemq/browse/CAMEL-1776

On Mon, Jun 22, 2009 at 6:21 AM, Claus Ibsen<cl...@gmail.com> wrote:
>
>
> On Thu, Jun 18, 2009 at 1:32 PM, SwenVogel <sw...@ypsystems.de> wrote:
>>
>> The problem is that all schemas must be present at the time of validating.
>> This is because the
>> element declarations ar spread across differnet schema files.
>>
>> But i think it should work when setting the Schema used by the
>> ValidatingProcessor manually:
>>
>>
>> ValidatingProcessor processor = new ValidatingProcessor();
>>
>> List<Source> schemaSources = new ArrayList<Source>();
>> // add all required schemas to the list
>>
>> Schema schema = processor.getSchemaFactory().newSchema(
>>    schemaSources.toArray(new Source[]{}));
>>
>> processor.setSchema(schema);
>>
>>
>> A nice component feature would be to specify a list of ressources, for
>> example in this way:
>> validator:someLocalOrRemoteResource,someLocalOrRemoteResource,...
>
> Hi
> Yeah good idea. Do you mind creating a ticket for this?
> Then we can add such a feature to the URI so you can pass in multiple
> resources, separated by comma.
>
>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/XML-Validation-with-multiple-XSLT-schema-files.-tp24068904p24091105.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: XML Validation with multiple XSLT schema files.

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jun 18, 2009 at 1:32 PM, SwenVogel <sw...@ypsystems.de> wrote:

>
> The problem is that all schemas must be present at the time of validating.
> This is because the
> element declarations ar spread across differnet schema files.
>
> But i think it should work when setting the Schema used by the
> ValidatingProcessor manually:
>
>
> ValidatingProcessor processor = new ValidatingProcessor();
>
> List<Source> schemaSources = new ArrayList<Source>();
> // add all required schemas to the list
>
> Schema schema = processor.getSchemaFactory().newSchema(
>    schemaSources.toArray(new Source[]{}));
>
> processor.setSchema(schema);
>
>
> A nice component feature would be to specify a list of ressources, for
> example in this way:
> validator:someLocalOrRemoteResource,someLocalOrRemoteResource,...


Hi

Yeah good idea. Do you mind creating a ticket for this?
Then we can add such a feature to the URI so you can pass in multiple
resources, separated by comma.




>
> --
> View this message in context:
> http://www.nabble.com/XML-Validation-with-multiple-XSLT-schema-files.-tp24068904p24091105.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: XML Validation with multiple XSLT schema files.

Posted by SwenVogel <sw...@ypsystems.de>.
The problem is that all schemas must be present at the time of validating.
This is because the 
element declarations ar spread across differnet schema files.

But i think it should work when setting the Schema used by the
ValidatingProcessor manually:


ValidatingProcessor processor = new ValidatingProcessor(); 

List<Source> schemaSources = new ArrayList<Source>();
// add all required schemas to the list

Schema schema = processor.getSchemaFactory().newSchema(
    schemaSources.toArray(new Source[]{}));

processor.setSchema(schema);


A nice component feature would be to specify a list of ressources, for
example in this way:
validator:someLocalOrRemoteResource,someLocalOrRemoteResource,...
-- 
View this message in context: http://www.nabble.com/XML-Validation-with-multiple-XSLT-schema-files.-tp24068904p24091105.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: XML Validation with multiple XSLT schema files.

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jun 17, 2009 at 10:09 AM, SwenVogel <sw...@ypsystems.de> wrote:

>
> Hi,
>
> how can i use the validation component when the source XML must be
> validated
> against multiple XSLT schema files? For example it is quite common to use a
> core schema and other additional schemas.


Maybe you could invoke the validator multiple times for each of the XSLT
files?



>
>
> Thanks for your help ...
> --
> View this message in context:
> http://www.nabble.com/XML-Validation-with-multiple-XSLT-schema-files.-tp24068904p24068904.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus