You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andreas Hartmann <an...@apache.org> on 2005/09/06 11:14:21 UTC

Jing validation component (was: JING Transformer...)

Pier Fumagalli wrote:

[...]

 > It's in Subversion right now... 2.1.x branch, "validation" block.

I tried it, it works nicely - thanks a lot!

Unfortunately we need an isolated valdiation service (not a transformer),
which I created using your code - mostly using copy & paste :(

Would you be interested in decoupling the validation functionality
(incl. protocol-based entity resolving) from the transformation functionality?

-- Andreas


Re: Jing validation component (was: JING Transformer...)

Posted by Andreas Hartmann <an...@apache.org>.
Pier Fumagalli wrote:

[...]

> I've made it as generic as possible, and unplugged anything related  to 
> Jing back as a schema parser.
> 
> Still working on it, but look at the interface, and tell me what you  
> think! :-P

Cool, that's exactly what we needed and it works like a charm!

If you meet Michael Wechner in Amsterdam, tell him to buy you a large
beer in the name of the Lenya community :)

Thanks a lot,

-- Andreas


Re: Jing validation component (was: JING Transformer...)

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 6 Sep 2005, at 10:14, Andreas Hartmann wrote:
> Pier Fumagalli wrote:
>
> [...]
>
> > It's in Subversion right now... 2.1.x branch, "validation" block.
>
> I tried it, it works nicely - thanks a lot!
>
> Unfortunately we need an isolated valdiation service (not a  
> transformer),
> which I created using your code - mostly using copy & paste :(
>
> Would you be interested in decoupling the validation functionality
> (incl. protocol-based entity resolving) from the transformation  
> functionality?

Just did a commit to SVN, using the  
"org.apache.cocoon.components.validation" package.

Can you check out that the "Validator" interface is what you actually  
need for your stuff?

I've made it as generic as possible, and unplugged anything related  
to Jing back as a schema parser.

Still working on it, but look at the interface, and tell me what you  
think! :-P

     Pier


Re: Jing validation component (was: JING Transformer...)

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 6 Sep 2005, at 13:41, Andreas Hartmann wrote:
> Pier Fumagalli wrote:
>> On 6 Sep 2005, at 10:14, Andreas Hartmann wrote:
>>
>>> Pier Fumagalli wrote:
>>>
>>> [...]
>>>
>>> > It's in Subversion right now... 2.1.x branch, "validation" block.
>>>
>>> I tried it, it works nicely - thanks a lot!
>>>
>>> Unfortunately we need an isolated valdiation service (not a   
>>> transformer),
>>> which I created using your code - mostly using copy & paste :(
>>>
>>> Would you be interested in decoupling the validation functionality
>>> (incl. protocol-based entity resolving) from the transformation   
>>> functionality?
>>>
>> So, a some sort of validation component that can be looked up  
>> using  the ServiceManager? Something along the lines of....
>> public interface Validator() {
>>   public static final String ROLE =   
>> "org.apache.cocoon.components.validation.Validator";
>>   public XMLConsumer getValidator(String schemaURI);
>>
>
> What would be the role of the XMLConsumer?

It would be where to send XML events for validation.

> The interface I used looked basically like this:
>
> public interface Validator {
>
>     String ROLE = Validator.class.getName();
>
>     void validate(String xmlUri, String schemaUri, ErrorHandler  
> handler);
>
> }
>
>
> But a SAX stream or something else as input would also be fine.

Both should be fine... I'll see if I can hack somehting together.

     Pier


Re: Jing validation component (was: JING Transformer...)

Posted by Andreas Hartmann <an...@apache.org>.
Pier Fumagalli wrote:
> On 6 Sep 2005, at 10:14, Andreas Hartmann wrote:
> 
>> Pier Fumagalli wrote:
>>
>> [...]
>>
>> > It's in Subversion right now... 2.1.x branch, "validation" block.
>>
>> I tried it, it works nicely - thanks a lot!
>>
>> Unfortunately we need an isolated valdiation service (not a  
>> transformer),
>> which I created using your code - mostly using copy & paste :(
>>
>> Would you be interested in decoupling the validation functionality
>> (incl. protocol-based entity resolving) from the transformation  
>> functionality?
> 
> 
> So, a some sort of validation component that can be looked up using  the 
> ServiceManager? Something along the lines of....
> 
> public interface Validator() {
> 
>   public static final String ROLE =  
> "org.apache.cocoon.components.validation.Validator";
> 
>   public XMLConsumer getValidator(String schemaURI);

What would be the role of the XMLConsumer?

The interface I used looked basically like this:

public interface Validator {

     String ROLE = Validator.class.getName();

     void validate(String xmlUri, String schemaUri, ErrorHandler handler);

}


But a SAX stream or something else as input would also be fine.

-- Andreas


Re: Jing validation component (was: JING Transformer...)

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 6 Sep 2005, at 10:14, Andreas Hartmann wrote:
> Pier Fumagalli wrote:
>
> [...]
>
> > It's in Subversion right now... 2.1.x branch, "validation" block.
>
> I tried it, it works nicely - thanks a lot!
>
> Unfortunately we need an isolated valdiation service (not a  
> transformer),
> which I created using your code - mostly using copy & paste :(
>
> Would you be interested in decoupling the validation functionality
> (incl. protocol-based entity resolving) from the transformation  
> functionality?

So, a some sort of validation component that can be looked up using  
the ServiceManager? Something along the lines of....

public interface Validator() {

   public static final String ROLE =  
"org.apache.cocoon.components.validation.Validator";

   public XMLConsumer getValidator(String schemaURI);

}

public class JingValidator implements Validator {
   ...
}

public class JingTransformer extends ServiceableTransformer {

   private Validator validator = null;

   public void service(ServiceManager manager) {
     super.service(manager);
     manager.lookup(Validator.ROLE);
   }
   ...
}

Is that what you're thinking of?

     Pier