You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "J. Joseph Benavidez" <jj...@redhat.com> on 2003/11/13 03:24:32 UTC

Re: WIBNI -- xml validation at build time

Still, it would be great to have a process that goes through all the 
pages of a tapestry application specification and validates all the 
pages... something that could be written as an ant target or maven goal 
would be great so we can integrate it into our build/continuous 
integration process...

Would it be possible to break out some of Spindle's checking logic into 
a standalone program?

j.joseph


Harish Krishnaswamy wrote:
> Spindle - the eclipse plug-in for developing Tapestry applications! 
> That's exactly what Spindle does and of course a lot more!! Check out 
> spindle.sourceforge.net, it is still under development but the stuff 
> that you are talking about is done. Spindle is still not available in 
> binary format, you will have to download the source from cvs and build 
> it. But very clear instructions are available in the email below, taken 
> from the Spindle list.
> 
> <----------------msg from spindle list-------------------->
> 
> Have the first cut of an editor for templates.
> 
> However, it depends on the solareclipse plugin from sourceforge. I checked
> out their code
> into eclipse so I expect that anybody who wants to try it out will also 
> need
> to.
> 
> pserver:anonymous@cvs.sourceforge.net:/cvsroot/solareclipse
> 
> the projects you need to check out are:
> 
> net.sf.solareclipse.ui
> net.sf.solareclipse.xml.ui
> 
> as an ancient reminder for anybody whos wondering how to build/run spindle:
> 
> http://article.gmane.org/gmane.comp.ide.eclipse.spindle.devel/23
> 
> and
> 
> http://article.gmane.org/gmane.comp.ide.eclipse.spindle.devel/24
> 
> (The following message no longer applies)
> 
> http://article.gmane.org/gmane.comp.ide.eclipse.spindle.devel/25
> 
> Geoffrey Longman
> Intelligent Works Inc.
> 
> <----------------msg from spindle list-------------------->
> 
> -Harish
> 
> Bryan Lewis wrote:
> 
>> One of the nice things about developing in Java and Tapestry is the 
>> good error
>> checking at build time, or at worst, sometimes at deploy time.  (Maybe 
>> it's
>> only me after three years of cleaning up WebObjects code that was 
>> written in
>> nasty old interpreted WebScript and with lots of key-value coding.)  
>> However,
>> it is still easy to get errors that don't pop up until you enter a 
>> particular
>> page at run-time.
>>
>> The obvious example is a syntax error in an xml specification file.  If I
>> accidentally omit the closing slash, as in:
>>
>>    <static-binding name="title">This is a title.<static-binding>
>>
>> I don't find out about it until I enter that page at run-time.  Yes, I 
>> know,
>> that's what unit testing is for, but still... I thought it would be 
>> helpful to
>> do a little validation on the xml files at build time.
>>
>> I tried the Sun Multi-Schema Validator (MSV) because that was the 
>> first one I
>> googled... but it seemed like huge overkill and I gave up trying to 
>> make sense
>> of it.
>>
>> Then I found Ant's XMLValidate task, which works pretty well for the 
>> tapestry
>> xml files.  It's easy to use and does catch the example above.
>>
>> <target name="xmlvalidate">
>>    <xmlvalidate lenient="no" warn="yes" failonerror="no">
>>        <fileset dir="src/${ant.project.name}" 
>> includes="**/*.page,**/*.jwc"/>
>>        <fileset dir="." includes="web/conf/*.application"/>
>>    </xmlvalidate>
>> </target>
>>
>> Notice that I apply it to the tapestry files (page, jwc, application) 
>> but not
>> to html templates.  When I tried it on those I got a lot of errors I 
>> don't
>> really care about like:
>>
>>    The element type "br" must be terminated...
>>    The entity "nbsp" was referenced, but not declared.
>>
>> Question 1:  Are those unavoidable because html is so loose?  Maybe I 
>> should
>> add a DTD
>> header line to all my html files?  tapestry will sometimes give a 
>> run-time
>> error about such things as mismatched <span> tags.
>>
>> (It also didn't work on my jboss-related xmls (like ejb-jar and 
>> jboss.xml).  I
>> got bogus errors like "The content of element type "entity" must 
>> match...".  I
>> call them bogus because they don't interfere with operation, and I 
>> can't make
>> sense of them by looking at the jboss DTD's.  They don't worry me too 
>> much,
>> though... I'm not sure the JBoss DTDs are up to date, and I rarely 
>> change these
>> files anyway, and JBoss does catch some of them at deploy-time.)
>>
>> Question 2:  Has anyone else tried something like this?
>>
>> Thanks,
>> Bryan Lewis
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>  
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: WIBNI -- xml validation at build time

Posted by Glen Stampoultzis <gs...@iinet.net.au>.
At 02:54 PM 13/11/2003, you wrote:
>On Wednesday, November 12, 2003, at 10:22  PM, Kevin C. Dorff wrote:
>>The .page, .jwc, and .application are all xml files with dtd's listed at 
>>top. You just just run xml validation on them (probably there is an ant 
>>task somewhere that will do this, dunno).
>
>Well, sure.... <xmlvalidate>.
>
>But, that is only a partial part of what I think was meant by 
>"validation".  It would be handy to have .html files and their jwcid's 
>matched up against the .page file, for example, to make sure there were no 
>jwcid's missing from the .page file.  I'm sure that Spindle does far more 
>than that even (although I'm an IDEA man myself).
>
>It would be great to see more build-time checking of the pieces though.
>
>         Erik

Like an ant task.  That _would_ be nice.




Glen Stampoultzis
gstamp@iinet.net.au
http://members.iinet.net.au/~gstamp/glen/

Re: WIBNI -- xml validation at build time

Posted by Geoff Longman <gl...@intelligentworks.com>.
http://data.intelligentworks.com/AntTask.pdf

Installment 1 of how to build an Ant Task to mimic the Spindle project
builder.

Actually, it not a how-to as I have no clue how to make ant tasks. Its more
an overview of the problem space and some things I did to make things work.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: WIBNI -- xml validation at build time

Posted by Geoff Longman <gl...@intelligentworks.com>.
I'll try and add a page to the Tapestry wiki describing what goes on this
weekend. Will post a note here when I have something.

Geoff
----- Original Message -----
From: "J. Joseph Benavidez" <jj...@redhat.com>
To: <ta...@jakarta.apache.org>
Sent: Saturday, November 15, 2003 3:13 AM
Subject: Re: WIBNI -- xml validation at build time


> Hi Geoff,
>
> As we're about to start a project using Tapestry, I'd be interested in
> investigating such a beast...
>
> I haven't any experience with eclipse code... can you point to some key
> classes to help me walk through the spindle code, and maybe discuss the
> eclipse code upon which spindle relies?
>
> Thanks,
>
> j.joseph
>
>
> On Thu, 2003-11-13 at 04:44, Geoff Longman wrote:
> > It would be tough to adapt the code Spindle uses to do this to an ant
task
> > because it depends on so much provided by Eclipse. One would have to
> > reproduce those services to a great degree.
> >
> > As past efforts have shown, Spindle is a never ending job. I don't think
> > I'll have time to spearhead such a project to build an ant task.
Although,
> > I'm happy to relate my experiences to anyone who might want to try it.
> >
> > Geoff
> >
> > P.S. in case there's anyone out there that doesn't know this yet,
Spindle
> > binaries are available.
> > ----- Original Message -----
> > From: "J. Joseph Benavidez" <jj...@redhat.com>
> > To: <ta...@jakarta.apache.org>
> > Sent: Thursday, November 13, 2003 6:03 AM
> > Subject: Re: WIBNI -- xml validation at build time
> >
> >
> > > Erik Hatcher wrote:
> > > > On Wednesday, November 12, 2003, at 10:22  PM, Kevin C. Dorff wrote:
> > > >
> > > >> The .page, .jwc, and .application are all xml files with dtd's
listed
> > > >> at top. You just just run xml validation on them (probably there is
an
> > > >> ant task somewhere that will do this, dunno).
> > > >
> > > >
> > > > Well, sure.... <xmlvalidate>.
> > > >
> > > > But, that is only a partial part of what I think was meant by
> > > > "validation".  It would be handy to have .html files and their
jwcid's
> > > > matched up against the .page file, for example, to make sure there
were
> > > > no jwcid's missing from the .page file.  I'm sure that Spindle does
far
> > > > more than that even (although I'm an IDEA man myself).
> > > >
> > > > It would be great to see more build-time checking of the pieces
though.
> > > >
> > > >     Erik
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
tapestry-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > > Right... I should have been clearer in my original posting. By
> > > "validation", I was referring to notes by Geoff Longman describing
> > > Spindle 3.0 in article
> > > http://article.gmane.org/gmane.comp.java.tapestry.user/4775, which
I'll
> > > reproduce here. Having an ant task or maven goal that does the
following
> > > would be very useful...
> > >
> > > ------------
> > > ...
> > > So, what's that [Spindle] good for?
> > >
> > > During the build, the builder finds many of the little niggly errors
that
> > > are not caught by the old version of Spindle. Malformed OGNL,
unresolvable
> > > classnames, unresolvable component names, are but a few of the errors
> > > caught. There are many more.
> > > Problems detected by the builder are marked in the Eclipse way. So,
you
> > get
> > > the error markers in the Gutters of your editor and the problems show
up
> > as
> > > tasks in the Tasks View. How many time have you started a Tapestry
runtime
> > > only to have it tank 'cuz you mistyped an OGNL expression? Spindle
will
> > > catch it ahead of time, saving you time.
> > >
> > > Spindle processes:
> > >
> > > web.xml
> > > .application files
> > > .jwc file
> > > .page files
> > > .html files (Templates!)
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: WIBNI -- xml validation at build time

Posted by "J. Joseph Benavidez" <jj...@redhat.com>.
Hi Geoff,

As we're about to start a project using Tapestry, I'd be interested in
investigating such a beast...

I haven't any experience with eclipse code... can you point to some key
classes to help me walk through the spindle code, and maybe discuss the
eclipse code upon which spindle relies?

Thanks,

j.joseph


On Thu, 2003-11-13 at 04:44, Geoff Longman wrote:
> It would be tough to adapt the code Spindle uses to do this to an ant task
> because it depends on so much provided by Eclipse. One would have to
> reproduce those services to a great degree.
> 
> As past efforts have shown, Spindle is a never ending job. I don't think
> I'll have time to spearhead such a project to build an ant task. Although,
> I'm happy to relate my experiences to anyone who might want to try it.
> 
> Geoff
> 
> P.S. in case there's anyone out there that doesn't know this yet, Spindle
> binaries are available.
> ----- Original Message -----
> From: "J. Joseph Benavidez" <jj...@redhat.com>
> To: <ta...@jakarta.apache.org>
> Sent: Thursday, November 13, 2003 6:03 AM
> Subject: Re: WIBNI -- xml validation at build time
> 
> 
> > Erik Hatcher wrote:
> > > On Wednesday, November 12, 2003, at 10:22  PM, Kevin C. Dorff wrote:
> > >
> > >> The .page, .jwc, and .application are all xml files with dtd's listed
> > >> at top. You just just run xml validation on them (probably there is an
> > >> ant task somewhere that will do this, dunno).
> > >
> > >
> > > Well, sure.... <xmlvalidate>.
> > >
> > > But, that is only a partial part of what I think was meant by
> > > "validation".  It would be handy to have .html files and their jwcid's
> > > matched up against the .page file, for example, to make sure there were
> > > no jwcid's missing from the .page file.  I'm sure that Spindle does far
> > > more than that even (although I'm an IDEA man myself).
> > >
> > > It would be great to see more build-time checking of the pieces though.
> > >
> > >     Erik
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> > Right... I should have been clearer in my original posting. By
> > "validation", I was referring to notes by Geoff Longman describing
> > Spindle 3.0 in article
> > http://article.gmane.org/gmane.comp.java.tapestry.user/4775, which I'll
> > reproduce here. Having an ant task or maven goal that does the following
> > would be very useful...
> >
> > ------------
> > ...
> > So, what's that [Spindle] good for?
> >
> > During the build, the builder finds many of the little niggly errors that
> > are not caught by the old version of Spindle. Malformed OGNL, unresolvable
> > classnames, unresolvable component names, are but a few of the errors
> > caught. There are many more.
> > Problems detected by the builder are marked in the Eclipse way. So, you
> get
> > the error markers in the Gutters of your editor and the problems show up
> as
> > tasks in the Tasks View. How many time have you started a Tapestry runtime
> > only to have it tank 'cuz you mistyped an OGNL expression? Spindle will
> > catch it ahead of time, saving you time.
> >
> > Spindle processes:
> >
> > web.xml
> > .application files
> > .jwc file
> > .page files
> > .html files (Templates!)
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: WIBNI -- xml validation at build time

Posted by Geoff Longman <gl...@intelligentworks.com>.
It would be tough to adapt the code Spindle uses to do this to an ant task
because it depends on so much provided by Eclipse. One would have to
reproduce those services to a great degree.

As past efforts have shown, Spindle is a never ending job. I don't think
I'll have time to spearhead such a project to build an ant task. Although,
I'm happy to relate my experiences to anyone who might want to try it.

Geoff

P.S. in case there's anyone out there that doesn't know this yet, Spindle
binaries are available.
----- Original Message -----
From: "J. Joseph Benavidez" <jj...@redhat.com>
To: <ta...@jakarta.apache.org>
Sent: Thursday, November 13, 2003 6:03 AM
Subject: Re: WIBNI -- xml validation at build time


> Erik Hatcher wrote:
> > On Wednesday, November 12, 2003, at 10:22  PM, Kevin C. Dorff wrote:
> >
> >> The .page, .jwc, and .application are all xml files with dtd's listed
> >> at top. You just just run xml validation on them (probably there is an
> >> ant task somewhere that will do this, dunno).
> >
> >
> > Well, sure.... <xmlvalidate>.
> >
> > But, that is only a partial part of what I think was meant by
> > "validation".  It would be handy to have .html files and their jwcid's
> > matched up against the .page file, for example, to make sure there were
> > no jwcid's missing from the .page file.  I'm sure that Spindle does far
> > more than that even (although I'm an IDEA man myself).
> >
> > It would be great to see more build-time checking of the pieces though.
> >
> >     Erik
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
> Right... I should have been clearer in my original posting. By
> "validation", I was referring to notes by Geoff Longman describing
> Spindle 3.0 in article
> http://article.gmane.org/gmane.comp.java.tapestry.user/4775, which I'll
> reproduce here. Having an ant task or maven goal that does the following
> would be very useful...
>
> ------------
> ...
> So, what's that [Spindle] good for?
>
> During the build, the builder finds many of the little niggly errors that
> are not caught by the old version of Spindle. Malformed OGNL, unresolvable
> classnames, unresolvable component names, are but a few of the errors
> caught. There are many more.
> Problems detected by the builder are marked in the Eclipse way. So, you
get
> the error markers in the Gutters of your editor and the problems show up
as
> tasks in the Tasks View. How many time have you started a Tapestry runtime
> only to have it tank 'cuz you mistyped an OGNL expression? Spindle will
> catch it ahead of time, saving you time.
>
> Spindle processes:
>
> web.xml
> .application files
> .jwc file
> .page files
> .html files (Templates!)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: WIBNI -- xml validation at build time

Posted by "J. Joseph Benavidez" <jj...@redhat.com>.
Erik Hatcher wrote:
> On Wednesday, November 12, 2003, at 10:22  PM, Kevin C. Dorff wrote:
> 
>> The .page, .jwc, and .application are all xml files with dtd's listed 
>> at top. You just just run xml validation on them (probably there is an 
>> ant task somewhere that will do this, dunno).
> 
> 
> Well, sure.... <xmlvalidate>.
> 
> But, that is only a partial part of what I think was meant by 
> "validation".  It would be handy to have .html files and their jwcid's 
> matched up against the .page file, for example, to make sure there were 
> no jwcid's missing from the .page file.  I'm sure that Spindle does far 
> more than that even (although I'm an IDEA man myself).
> 
> It would be great to see more build-time checking of the pieces though.
> 
>     Erik
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 

Right... I should have been clearer in my original posting. By 
"validation", I was referring to notes by Geoff Longman describing 
Spindle 3.0 in article 
http://article.gmane.org/gmane.comp.java.tapestry.user/4775, which I'll 
reproduce here. Having an ant task or maven goal that does the following 
would be very useful...

------------
...
So, what's that [Spindle] good for?

During the build, the builder finds many of the little niggly errors that
are not caught by the old version of Spindle. Malformed OGNL, unresolvable
classnames, unresolvable component names, are but a few of the errors
caught. There are many more.
Problems detected by the builder are marked in the Eclipse way. So, you get
the error markers in the Gutters of your editor and the problems show up as
tasks in the Tasks View. How many time have you started a Tapestry runtime
only to have it tank 'cuz you mistyped an OGNL expression? Spindle will
catch it ahead of time, saving you time.

Spindle processes:

web.xml
.application files
.jwc file
.page files
.html files (Templates!)



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: WIBNI -- xml validation at build time

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Wednesday, November 12, 2003, at 10:22  PM, Kevin C. Dorff wrote:
> The .page, .jwc, and .application are all xml files with dtd's listed 
> at top. You just just run xml validation on them (probably there is an 
> ant task somewhere that will do this, dunno).

Well, sure.... <xmlvalidate>.

But, that is only a partial part of what I think was meant by 
"validation".  It would be handy to have .html files and their jwcid's 
matched up against the .page file, for example, to make sure there were 
no jwcid's missing from the .page file.  I'm sure that Spindle does far 
more than that even (although I'm an IDEA man myself).

It would be great to see more build-time checking of the pieces though.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: WIBNI -- xml validation at build time

Posted by "Kevin C. Dorff" <kd...@dorffweb.com>.
The .page, .jwc, and .application are all xml files with dtd's listed at 
top. You just just run xml validation on them (probably there is an ant 
task somewhere that will do this, dunno).

Kevin

J. Joseph Benavidez wrote:

> Still, it would be great to have a process that goes through all the 
> pages of a tapestry application specification and validates all the 
> pages... something that could be written as an ant target or maven 
> goal would be great so we can integrate it into our build/continuous 
> integration process...
>
> Would it be possible to break out some of Spindle's checking logic 
> into a standalone program?
>
> j.joseph
>
>
> Harish Krishnaswamy wrote:
>
>> Spindle - the eclipse plug-in for developing Tapestry applications! 
>> That's exactly what Spindle does and of course a lot more!! Check out 
>> spindle.sourceforge.net, it is still under development but the stuff 
>> that you are talking about is done. Spindle is still not available in 
>> binary format, you will have to download the source from cvs and 
>> build it. But very clear instructions are available in the email 
>> below, taken from the Spindle list.
>>
>> <----------------msg from spindle list-------------------->
>>
>> Have the first cut of an editor for templates.
>>
>> However, it depends on the solareclipse plugin from sourceforge. I 
>> checked
>> out their code
>> into eclipse so I expect that anybody who wants to try it out will 
>> also need
>> to.
>>
>> pserver:anonymous@cvs.sourceforge.net:/cvsroot/solareclipse
>>
>> the projects you need to check out are:
>>
>> net.sf.solareclipse.ui
>> net.sf.solareclipse.xml.ui
>>
>> as an ancient reminder for anybody whos wondering how to build/run 
>> spindle:
>>
>> http://article.gmane.org/gmane.comp.ide.eclipse.spindle.devel/23
>>
>> and
>>
>> http://article.gmane.org/gmane.comp.ide.eclipse.spindle.devel/24
>>
>> (The following message no longer applies)
>>
>> http://article.gmane.org/gmane.comp.ide.eclipse.spindle.devel/25
>>
>> Geoffrey Longman
>> Intelligent Works Inc.
>>
>> <----------------msg from spindle list-------------------->
>>
>> -Harish
>>
>> Bryan Lewis wrote:
>>
>>> One of the nice things about developing in Java and Tapestry is the 
>>> good error
>>> checking at build time, or at worst, sometimes at deploy time.  
>>> (Maybe it's
>>> only me after three years of cleaning up WebObjects code that was 
>>> written in
>>> nasty old interpreted WebScript and with lots of key-value coding.)  
>>> However,
>>> it is still easy to get errors that don't pop up until you enter a 
>>> particular
>>> page at run-time.
>>>
>>> The obvious example is a syntax error in an xml specification file.  
>>> If I
>>> accidentally omit the closing slash, as in:
>>>
>>>    <static-binding name="title">This is a title.<static-binding>
>>>
>>> I don't find out about it until I enter that page at run-time.  Yes, 
>>> I know,
>>> that's what unit testing is for, but still... I thought it would be 
>>> helpful to
>>> do a little validation on the xml files at build time.
>>>
>>> I tried the Sun Multi-Schema Validator (MSV) because that was the 
>>> first one I
>>> googled... but it seemed like huge overkill and I gave up trying to 
>>> make sense
>>> of it.
>>>
>>> Then I found Ant's XMLValidate task, which works pretty well for the 
>>> tapestry
>>> xml files.  It's easy to use and does catch the example above.
>>>
>>> <target name="xmlvalidate">
>>>    <xmlvalidate lenient="no" warn="yes" failonerror="no">
>>>        <fileset dir="src/${ant.project.name}" 
>>> includes="**/*.page,**/*.jwc"/>
>>>        <fileset dir="." includes="web/conf/*.application"/>
>>>    </xmlvalidate>
>>> </target>
>>>
>>> Notice that I apply it to the tapestry files (page, jwc, 
>>> application) but not
>>> to html templates.  When I tried it on those I got a lot of errors I 
>>> don't
>>> really care about like:
>>>
>>>    The element type "br" must be terminated...
>>>    The entity "nbsp" was referenced, but not declared.
>>>
>>> Question 1:  Are those unavoidable because html is so loose?  Maybe 
>>> I should
>>> add a DTD
>>> header line to all my html files?  tapestry will sometimes give a 
>>> run-time
>>> error about such things as mismatched <span> tags.
>>>
>>> (It also didn't work on my jboss-related xmls (like ejb-jar and 
>>> jboss.xml).  I
>>> got bogus errors like "The content of element type "entity" must 
>>> match...".  I
>>> call them bogus because they don't interfere with operation, and I 
>>> can't make
>>> sense of them by looking at the jboss DTD's.  They don't worry me 
>>> too much,
>>> though... I'm not sure the JBoss DTDs are up to date, and I rarely 
>>> change these
>>> files anyway, and JBoss does catch some of them at deploy-time.)
>>>
>>> Question 2:  Has anyone else tried something like this?
>>>
>>> Thanks,
>>> Bryan Lewis
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>  
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org