Now that's service! :-)

Btw, I got an error trying to build this new validation block - but you
may want to ignore it because it occurs when I build it into 2.1.7 (I
downloaded the just individual validation block and added it to 2.1.7 -
I still need some time to convince everyone that we should move to 2.1.8
this late in the project...)

The error occurs when running "build war":

BUILD FAILED
C:\local\src\trunk\cocoon-2.1.7\tools\targets\webapp-build.xml:106: The
followin
g error occurred while executing this line:
C:\local\src\trunk\cocoon-2.1.7\build\cocoon-2.1.7\temp\blocks-build.xml
:3043: T
he following error occurred while executing this line:
C:\local\src\trunk\cocoon-2.1.7\build\cocoon-2.1.7\temp\blocks-build.xml
:147: Tr
ansformerException: org.apache.xpath.XPathException: Can not convert
#BOOLEAN to
 a NodeList!

This is caused by the

                unless="@version != '2.1' or validator"

attribute in line 18 of validation.xconf

If I drop this then the build succeeds. Maybe this is just a 2.1.7
compatibility issue?

Cheers,
Ollie

-----Original Message-----
From: Ralph Goers [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 26 October 2005 6:42 p.m.
To: [email protected]
Subject: Re: XML Validation with FileGenerator



Oliver Powell wrote:

> I am using XML from external providers and as part of the business
> rules I must validate it. I want the SAX parser in the FileGenerator
> to validate it against its XSD. Ideally, I'd like to be able to
> localise XML validation to this particular pipeline and generator.
> For the most part I don't want it enabled. Is there an easy way to do
> this?  I've also hunted around the source-code and the cocoon-user
> list for an easy way to do this, but nothing jumped out.
> 
> So far I've only discovered the global "validate=true" switch for the
> xml-parser in cocoon.xconf, which doesn't help me (the sitemap doesn't

> even parse, let alone my external xml!). I noticed the comment next to

> this configuration:
>   
>         "XML validation is only being used for the documentation
> build. If you are going to use it elsewhere, then do so with caution.
> You really should have validated all of your XML documents already,
> according to their proper DTD or schema. Do not expect Cocoon to do
it."
> 
> I'm surprised by this statement. I expected an XML-based engine like
> Cocoon to be more supportive of XML validation. And in my position,
> with externally-supplied XML, I can't assume my XML has been validated

> previously. I'd rather not create an intermediate step outside Cocoon
> to perform this validation either.
> 
> It looks like the FileGenerator (and SourceUtil) doesn't parameterise
> this, so I suspect I'll have to write my own generator that uses a
> specially configured second SAXParser with validate=true (I'd rather
> not mess with the default parser).
> 
> It just seems a shame that I must go to these lengths just to have XML

> validation in a localised way, so I'm hoping someone on the list has a

> better suggestion.
> 
> Thanks,
> Ollie
>
Can you wait a week?  Release 2.1.8 will have a validation block that
includes the ValidatingTransformer. I believe it will achieve what you
want.

Ralph

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

=====================================================================
CAUTION: This e-mail and any attachment(s) contains information that
is intended to be read only by the named recipient(s). It may contain
information that is confidential, proprietary or the subject of legal
privilege. This information is not to be used by any other person
and/or organisation. If you are not the intended recipient, please
advise us immediately and delete this e-mail from your system. Do not
use any information contained in it.

================================================================
For more information on the Television New Zealand Group, visit us
online at http://www.tvnz.co.nz
================================================================

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