Re: Schematron transform in a Cocoon pipeline

2003-01-22 Thread jtacaoio

Jack,

I also use it to validate uploaded documents. First, when cocoon 
receives the document, I applied to it the first validation step with 
the parser (inside the generator): the parser will check that the 
document is well formed and valid according to a certain W3C XML 
Schema. But there are some verifications which can't be done with the 
schema, so for them I use the Schematron which is embedded in the W3C 
Schema.


























Now, as Jeff Turner suggested in http://marc.theaimsgroup.com/?l=xml-
cocoon-users&m=104308827116656&w=2 , I'm thinking on moving the W3C 
schemaValidation from the generator to a transformer 
(ValidationTransformer), using JARV.

Oskar

> Oskar,
> 
> Excellent suggestion.  The XPATH of the error would be very useful for
> debugging.  What applications of Schematron have you done within 
Cocoon?
> So far, I'm using it to validate uploaded documents.
> 
> -- jack
> 
> > 
> > Hi Jack,
> > 
> > I have done the same to validate an XML document with an 
schematron. I think
> > that it would be also useful to get the XPATH path of the errors in 
the XML
> > output. The template which does this is done in skeleton1-5 
( > match="*|@*" mode="schematron-get-full-path">); so you have to call 
it from
> > the assert template:
> > 
> > 
> > 
> > Markup Error: no test attribute in
> > 
> > 
> > 
> > 
> > 
> >  
> >  
> > 
> > 
> > 
> >  > select="normalize-space(@test)" />
> > 
> > 
> >  > select="@diagnostics"/>
> > 
> > 
> >  
> >  > select="self::*"/> 
> > 
> > 
> >  
> > 
> > 
> > 
> > Oskar
> > 
> > - Original Message -
> > From: "John R. Callahan" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 21, 2003 9:58 PM
> > Subject: Schematron transform in a Cocoon pipeline
> > 
> > 
> > > This seems too simple, but I wanted to see if I could
> > > use Schematron generated XSLT to validate some
> > > XML in a Cocoon pipeline.  This might be used for
> > > validating uploaded  XML files for example.
> > >
> > > I downloaded the latest Schematron skeleton (1.5),
> > > then generated some XSLT from a set of assertions,
> > > and then put it into a transform in a pipeline with some
> > > data:
> > >
> > > 
> > >   
> > >   
> > >   
> > > 
> > >
> > > 
> > > 
> > >   
> > >   
> > >   
> > >   
> > >   
> > >   
> > >   
> > >   
> > > 
> > >
> > > (see below for the source code for store.xsl)
> > >
> > > Unfortunately, the Schematron skeleton puts out plain
> > > text messages so the output from data1.xml isn't well-formed
> > > XML.  What I wanted was a series of applicable
> > > Schematron messages as XML output.  So, I altered
> > > the skeleton somewhat and now I works!
> > >
> > > My alterations to the skeleton were pretty simple:
> > >
> > > (1)  Add the following template:
> > >
> > > 
> > >  
> > > 
> > >
> > > (2) Wrap a  around the "/" template:
> > >
> > >   
> > >   
> > >   
> > > ...
> > >   
> > >   
> > >   
> > >
> > > Finally, you must wrap all messages in the .sch file with
> > > ... as follows:
> > >
> > > http://www.ascc.net/xml/schematron";>
> > > ...
> > > 
> > >   If the Title is "Mr" then the sex of the person must 
be
> > "Male".
> > > 
> > > ...
> > > 
> > >
> > > Enjoy!
> > >
> > > -- jack
> > >
> > >
> > > (The XSLT file "store.xsl" is my own brew to wrap an
> > > element around the input source for use by the subsequent
> > > SourceWriterTransformer:
> > >
> > 

Re: Schematron transform in a Cocoon pipeline

2003-01-22 Thread Jeremy Quinn

On Tuesday, Jan 21, 2003, at 20:58 Europe/London, John R. Callahan 
wrote:

This seems too simple, but I wanted to see if I could
use Schematron generated XSLT to validate some
XML in a Cocoon pipeline.  This might be used for
validating uploaded  XML files for example.



You might find the 'slash-edit' sample in Cocoon 2.1 scratchpad a 
useful example, it is based on the skeleton 1.5 if I remember 
correctly. The validating XSLT is generated from an internal pipeline.

regards Jeremy


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>



Re: Schematron transform in a Cocoon pipeline

2003-01-22 Thread Oskar Casquero
Jack,

I also use it to validate uploaded documents. When cocoon receives the
document, first, I check with the parser (inside the generator), that the
document is well formed and valid according to a certain W3C Schema. But
there are some verifications that the W3C Schema can't check, so, for them,
there is a second validation step, in which I use the Schematron which is
embedded in the W3C Schema.

























Now, as Jeff Turner suggested
(http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=104306512017996&w=2),
I'm thinking on moving the W3C Schema validation from the generator to a
transformer (ValidationTransformer), because I had an example where the
validation must be after procesing the document.

Oskar

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 1:24 PM
Subject: Re: Schematron transform in a Cocoon pipeline


> Oskar,
>
> Excellent suggestion.  The XPATH of the error would be very useful for
> debugging.  What applications of Schematron have you done within Cocoon?
> So far, I'm using it to validate uploaded documents.
>
> -- jack
>
> >
> > Hi Jack,
> >
> > I have done the same to validate an XML document with an schematron. I
think
> > that it would be also useful to get the XPATH path of the errors in the
XML
> > output. The template which does this is done in skeleton1-5
( > match="*|@*" mode="schematron-get-full-path">); so you have to call it
from
> > the assert template:
> >
> > 
> > 
> > Markup Error: no test attribute in
> > <assert>
> > 
> > 
> > 
> > 
> >  
> >  
> > 
> > 
> > 
> >  > select="normalize-space(@test)" />
> > 
> > 
> >  > select="@diagnostics"/>
> > 
> > 
> >  
> >      > select="self::*"/> 
> > 
> > 
> >  
> > 
> > 
> >
> > Oskar
> >
> > - Original Message -
> > From: "John R. Callahan" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 21, 2003 9:58 PM
> > Subject: Schematron transform in a Cocoon pipeline
> >
> >
> > > This seems too simple, but I wanted to see if I could
> > > use Schematron generated XSLT to validate some
> > > XML in a Cocoon pipeline.  This might be used for
> > > validating uploaded  XML files for example.
> > >
> > > I downloaded the latest Schematron skeleton (1.5),
> > > then generated some XSLT from a set of assertions,
> > > and then put it into a transform in a pipeline with some
> > > data:
> > >
> > > 
> > >   
> > >   
> > >   
> > > 
> > >
> > > 
> > > 
> > >   
> > >   
> > >   
> > >   
> > >   
> > >   
> > >   
> > >   
> > > 
> > >
> > > (see below for the source code for store.xsl)
> > >
> > > Unfortunately, the Schematron skeleton puts out plain
> > > text messages so the output from data1.xml isn't well-formed
> > > XML.  What I wanted was a series of applicable
> > > Schematron messages as XML output.  So, I altered
> > > the skeleton somewhat and now I works!
> > >
> > > My alterations to the skeleton were pretty simple:
> > >
> > > (1)  Add the following template:
> > >
> > > 
> > >  
> > > 
> > >
> > > (2) Wrap a  around the "/" template:
> > >
> > >   
> > >   
> > >   
> > > ...
> > >   
> > >   
> > >   
> > >
> > > Finally, you must wrap all messages in the .sch file with
> > > ... as follows:
> > >
> > > http://www.ascc.net/xml/schematron";>
> > > ...
> > > 
> > >   If the Title is "Mr" then the sex of the person must be
> > "Male".
> > > 
> > > ...
> > > 
> > >
> > > Enjoy!
> > >
> > > -- jack
> > >
> > >

Re: Schematron transform in a Cocoon pipeline

2003-01-22 Thread jcallahan
Oskar,

Excellent suggestion.  The XPATH of the error would be very useful for
debugging.  What applications of Schematron have you done within Cocoon?
So far, I'm using it to validate uploaded documents.

-- jack

> 
> Hi Jack,
> 
> I have done the same to validate an XML document with an schematron. I think
> that it would be also useful to get the XPATH path of the errors in the XML
> output. The template which does this is done in skeleton1-5 ( match="*|@*" mode="schematron-get-full-path">); so you have to call it from
> the assert template:
> 
> 
> 
> Markup Error: no test attribute in
> <assert>
> 
> 
> 
> 
>  
>  
> 
> 
> 
>  select="normalize-space(@test)" />
> 
> 
>  select="@diagnostics"/>
> 
> 
>  
>  select="self::*"/> 
> 
> 
>  
> 
> 
> 
> Oskar
> 
> - Original Message -
> From: "John R. Callahan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 21, 2003 9:58 PM
> Subject: Schematron transform in a Cocoon pipeline
> 
> 
> > This seems too simple, but I wanted to see if I could
> > use Schematron generated XSLT to validate some
> > XML in a Cocoon pipeline.  This might be used for
> > validating uploaded  XML files for example.
> >
> > I downloaded the latest Schematron skeleton (1.5),
> > then generated some XSLT from a set of assertions,
> > and then put it into a transform in a pipeline with some
> > data:
> >
> > 
> >   
> >   
> >   
> > 
> >
> > 
> > 
> >   
> >   
> >   
> >   
> >   
> >   
> >   
> >   
> > 
> >
> > (see below for the source code for store.xsl)
> >
> > Unfortunately, the Schematron skeleton puts out plain
> > text messages so the output from data1.xml isn't well-formed
> > XML.  What I wanted was a series of applicable
> > Schematron messages as XML output.  So, I altered
> > the skeleton somewhat and now I works!
> >
> > My alterations to the skeleton were pretty simple:
> >
> > (1)  Add the following template:
> >
> > 
> >  
> > 
> >
> > (2) Wrap a  around the "/" template:
> >
> >   
> >   
> >   
> > ...
> >   
> >   
> >   
> >
> > Finally, you must wrap all messages in the .sch file with
> > ... as follows:
> >
> > http://www.ascc.net/xml/schematron";>
> > ...
> > 
> >   If the Title is "Mr" then the sex of the person must be
> "Male".
> > 
> > ...
> > 
> >
> > Enjoy!
> >
> > -- jack
> >
> >
> > (The XSLT file "store.xsl" is my own brew to wrap an
> > element around the input source for use by the subsequent
> > SourceWriterTransformer:
> >
> > 
> > 
> >
> >  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >
> > 
> > 
> >
> > 
> > http://apache.org/cocoon/source/1.0";>
> >  / select="$file"/>
> >  
> >  
> >  
> > 
> > 
> >
> > 
> > )
> >
> >
> >
> > -
> > Please check that your question  has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> > For additional commands, e-mail:   <[EMAIL PROTECTED]>
> >
> 
> 
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: Schematron transform in a Cocoon pipeline

2003-01-21 Thread Oskar Casquero
Hi Jack,

I have done the same to validate an XML document with an schematron. I think
that it would be also useful to get the XPATH path of the errors in the XML
output. The template which does this is done in skeleton1-5 (); so you have to call it from
the assert template:



Markup Error: no test attribute in
<assert>




 
 









 
 


 



Oskar

- Original Message -
From: "John R. Callahan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 21, 2003 9:58 PM
Subject: Schematron transform in a Cocoon pipeline


> This seems too simple, but I wanted to see if I could
> use Schematron generated XSLT to validate some
> XML in a Cocoon pipeline.  This might be used for
> validating uploaded  XML files for example.
>
> I downloaded the latest Schematron skeleton (1.5),
> then generated some XSLT from a set of assertions,
> and then put it into a transform in a pipeline with some
> data:
>
> 
>   
>   
>   
> 
>
> 
> 
>   
>   
>   
>   
>   
>   
>   
>   
> 
>
> (see below for the source code for store.xsl)
>
> Unfortunately, the Schematron skeleton puts out plain
> text messages so the output from data1.xml isn't well-formed
> XML.  What I wanted was a series of applicable
> Schematron messages as XML output.  So, I altered
> the skeleton somewhat and now I works!
>
> My alterations to the skeleton were pretty simple:
>
> (1)  Add the following template:
>
> 
>  
> 
>
> (2) Wrap a  around the "/" template:
>
>   
>   
>   
> ...
>   
>   
>   
>
> Finally, you must wrap all messages in the .sch file with
> ... as follows:
>
> http://www.ascc.net/xml/schematron";>
> ...
> 
>   If the Title is "Mr" then the sex of the person must be
"Male".
> 
> ...
> 
>
> Enjoy!
>
> -- jack
>
>
> (The XSLT file "store.xsl" is my own brew to wrap an
> element around the input source for use by the subsequent
> SourceWriterTransformer:
>
> 
> 
>
> http://www.w3.org/1999/XSL/Transform";>
>
> 
> 
>
> 
> http://apache.org/cocoon/source/1.0";>
>  /
>  
>  
>  
> 
> 
>
> 
> )
>
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Schematron transform in a Cocoon pipeline

2003-01-21 Thread John R. Callahan
This seems too simple, but I wanted to see if I could
use Schematron generated XSLT to validate some
XML in a Cocoon pipeline.  This might be used for
validating uploaded  XML files for example.

I downloaded the latest Schematron skeleton (1.5),
then generated some XSLT from a set of assertions,
and then put it into a transform in a pipeline with some
data:


  
  
  




  
  
  
  
  
  
  
  


(see below for the source code for store.xsl)

Unfortunately, the Schematron skeleton puts out plain
text messages so the output from data1.xml isn't well-formed
XML.  What I wanted was a series of applicable 
Schematron messages as XML output.  So, I altered
the skeleton somewhat and now I works!

My alterations to the skeleton were pretty simple:

(1)  Add the following template:


 


(2) Wrap a  around the "/" template:

  
  
  
...
  
  
  

Finally, you must wrap all messages in the .sch file with
... as follows:

http://www.ascc.net/xml/schematron";>
...

  If the Title is "Mr" then the sex of the person must be 
"Male".

...


Enjoy!

-- jack


(The XSLT file "store.xsl" is my own brew to wrap an
element around the input source for use by the subsequent
SourceWriterTransformer:




http://www.w3.org/1999/XSL/Transform";>





http://apache.org/cocoon/source/1.0";>
 /
 
 
 




)



-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>