You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julian Dunn <Ju...@CBC.CA> on 2009/05/20 20:54:20 UTC

xml validation on -- good idea or not?

Hi,

Is it a good idea to run with xmlValidation="true" in server.xml?

I had this on for a while, but then it mysteriously stopped working --
the container could no longer validate DTDs, refused to load webapps,
etc.

What does xmlValidation="true" actually do?

I am using Tomcat 5.5.23.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: xml validation on -- good idea or not?

Posted by Xie Xiaodong <xx...@gmail.com>.
I think it just validates the xml file using the DTDs or xml-schemas
specified in your xml file. If you could not connect to the url you
specified in the dtds or xml-schemas, the situation you encountered might
happen.



2009/5/20 Julian Dunn <Ju...@cbc.ca>

>
> Hi,
>
> Is it a good idea to run with xmlValidation="true" in server.xml?
>
> I had this on for a while, but then it mysteriously stopped working --
> the container could no longer validate DTDs, refused to load webapps,
> etc.
>
> What does xmlValidation="true" actually do?
>
> I am using Tomcat 5.5.23.
>
> - Julian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sincerely yours and Best Regards,
Xie Xiaodong

RE: xml validation on -- good idea or not?

Posted by Martin Gainty <mg...@hotmail.com>.

if alternate algorithm can be made to define and require elements
ELEMENT web-app , ELEMENT auth-constraint, ELEMENT auth-method within deployed web.xml then
1)remove all DTD's and remove the flag

or
2)keep the DTDs and enable the flag

?
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Thu, 21 May 2009 17:42:37 -0400
> From: Julian.Dunn@CBC.CA
> To: users@tomcat.apache.org
> Subject: Re: xml validation on -- good idea or not?
> 
> I'm tempted to say that it should be removed if it's unstable. I don't
> know that much about the guts of Tomcat but we've seen errors thrown by
> some of those classes in the commits.
> 
> Thanks for your advice on the matter. I think we'll run with
> xmlValidation="false" from now on.
> 
> - Julian
> 
> >>> Mark Thomas <ma...@apache.org> 5/21/2009 3:51 AM >>>
> Bill Barker wrote:
> > "Julian Dunn" <Ju...@CBC.CA> wrote in message 
> > news:4A14199C.4CAF.003C.0@CBC.CA...
> >> Hi,
> >>
> >> Is it a good idea to run with xmlValidation="true" in server.xml?
> >>
> > 
> > In a development enviroment, it can be helpful (especially if you
> change 
> > web.xml often).  I would generally discurage it in a production
> environment 
> > since the app will take slightly longer to load.
> > 
> >> I had this on for a while, but then it mysteriously stopped working
> --
> >> the container could no longer validate DTDs, refused to load
> webapps,
> >> etc.
> >>
> > 
> > And another good reason to not use it in production ;).
> > 
> >> What does xmlValidation="true" actually do?
> >>
> > 
> > Xie is basically right, except that Tomcat *should* be using the
> schemas 
> > that it ships with.  So not having an internet connection is not
> supposed to 
> > be a problem.
> 
> It is worth noting that there are a bunch of issues with validation in
> 6.0.x and, I suspect, 5.5.x as well. See:
> 
> http://svn.apache.org/viewvc?rev=751502&view=rev 
> http://svn.apache.org/viewvc?rev=752589&view=rev 
> http://svn.apache.org/viewvc?rev=752584&view=rev 
> http://svn.apache.org/viewvc?rev=753035&view=rev 
> http://svn.apache.org/viewvc?rev=753036&view=rev 
> 
> Given that it has been broken for all of 6.0.x, I was debating
> removing
> xml validation completely in Tomcat 7. I'd be interested in any views
> people have on this.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org 
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Hotmail® goes with you. 
http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009

Re: xml validation on -- good idea or not?

Posted by Julian Dunn <Ju...@CBC.CA>.
I'm tempted to say that it should be removed if it's unstable. I don't
know that much about the guts of Tomcat but we've seen errors thrown by
some of those classes in the commits.

Thanks for your advice on the matter. I think we'll run with
xmlValidation="false" from now on.

- Julian

>>> Mark Thomas <ma...@apache.org> 5/21/2009 3:51 AM >>>
Bill Barker wrote:
> "Julian Dunn" <Ju...@CBC.CA> wrote in message 
> news:4A14199C.4CAF.003C.0@CBC.CA...
>> Hi,
>>
>> Is it a good idea to run with xmlValidation="true" in server.xml?
>>
> 
> In a development enviroment, it can be helpful (especially if you
change 
> web.xml often).  I would generally discurage it in a production
environment 
> since the app will take slightly longer to load.
> 
>> I had this on for a while, but then it mysteriously stopped working
--
>> the container could no longer validate DTDs, refused to load
webapps,
>> etc.
>>
> 
> And another good reason to not use it in production ;).
> 
>> What does xmlValidation="true" actually do?
>>
> 
> Xie is basically right, except that Tomcat *should* be using the
schemas 
> that it ships with.  So not having an internet connection is not
supposed to 
> be a problem.

It is worth noting that there are a bunch of issues with validation in
6.0.x and, I suspect, 5.5.x as well. See:

http://svn.apache.org/viewvc?rev=751502&view=rev 
http://svn.apache.org/viewvc?rev=752589&view=rev 
http://svn.apache.org/viewvc?rev=752584&view=rev 
http://svn.apache.org/viewvc?rev=753035&view=rev 
http://svn.apache.org/viewvc?rev=753036&view=rev 

Given that it has been broken for all of 6.0.x, I was debating
removing
xml validation completely in Tomcat 7. I'd be interested in any views
people have on this.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org 
For additional commands, e-mail: users-help@tomcat.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: xml validation on -- good idea or not?

Posted by Mark Thomas <ma...@apache.org>.
Bill Barker wrote:
> "Julian Dunn" <Ju...@CBC.CA> wrote in message 
> news:4A14199C.4CAF.003C.0@CBC.CA...
>> Hi,
>>
>> Is it a good idea to run with xmlValidation="true" in server.xml?
>>
> 
> In a development enviroment, it can be helpful (especially if you change 
> web.xml often).  I would generally discurage it in a production environment 
> since the app will take slightly longer to load.
> 
>> I had this on for a while, but then it mysteriously stopped working --
>> the container could no longer validate DTDs, refused to load webapps,
>> etc.
>>
> 
> And another good reason to not use it in production ;).
> 
>> What does xmlValidation="true" actually do?
>>
> 
> Xie is basically right, except that Tomcat *should* be using the schemas 
> that it ships with.  So not having an internet connection is not supposed to 
> be a problem.

It is worth noting that there are a bunch of issues with validation in
6.0.x and, I suspect, 5.5.x as well. See:

http://svn.apache.org/viewvc?rev=751502&view=rev
http://svn.apache.org/viewvc?rev=752589&view=rev
http://svn.apache.org/viewvc?rev=752584&view=rev
http://svn.apache.org/viewvc?rev=753035&view=rev
http://svn.apache.org/viewvc?rev=753036&view=rev

Given that it has been broken for all of 6.0.x, I was debating removing
xml validation completely in Tomcat 7. I'd be interested in any views
people have on this.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: xml validation on -- good idea or not?

Posted by Bill Barker <wb...@wilshire.com>.
"Julian Dunn" <Ju...@CBC.CA> wrote in message 
news:4A14199C.4CAF.003C.0@CBC.CA...
>
> Hi,
>
> Is it a good idea to run with xmlValidation="true" in server.xml?
>

In a development enviroment, it can be helpful (especially if you change 
web.xml often).  I would generally discurage it in a production environment 
since the app will take slightly longer to load.

> I had this on for a while, but then it mysteriously stopped working --
> the container could no longer validate DTDs, refused to load webapps,
> etc.
>

And another good reason to not use it in production ;).

> What does xmlValidation="true" actually do?
>

Xie is basically right, except that Tomcat *should* be using the schemas 
that it ships with.  So not having an internet connection is not supposed to 
be a problem.

> I am using Tomcat 5.5.23.
>
> - Julian 




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: xml validation on -- good idea or not?

Posted by Martin Gainty <mg...@hotmail.com>.
there are 2 terms you should know
  <parameter name="xmlNamespaceAware"
          description="Attribute value used to turn on/off XML namespace awareness"
               type="boolean"/>

      <parameter name="xmlValidation"
               description="Attribute value used to turn on/off XML validation"
               type="boolean"/>

used by the Host interface
    /*** Get the server.xml <host> attribute's xmlValidation.
     * @return true if validation is enabled.
     */
    public boolean getXmlValidation();

    /**
     * Set the validation feature of the XML parser used when
     * parsing xml instances.
     * @param xmlValidation true to enable xml instance validation
     */
    public void setXmlValidation(boolean xmlValidation);

    /**
     * Get the server.xml <host> attribute's xmlNamespaceAware.
     * @return true if namespace awarenes is enabled.
     *
     */
    public boolean getXmlNamespaceAware();

   /**
     * Set the namespace aware feature of the XML parser used when
     * parsing xml instances.
     * @param xmlNamespaceAware true to enable namespace awareness
     */
    public void setXmlNamespaceAware(boolean xmlNamespaceAware);

Validating against DTDs will only be applicable if DTD is located on classpath
and DTD is referenced in header of XML document e.g.

<?xml version = "1.0" ?>

      <!DOCTYPE Employee SYSTEM "Employee.dtd">

HTH
Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Wed, 20 May 2009 14:54:20 -0400
> From: Julian.Dunn@CBC.CA
> To: users@tomcat.apache.org
> Subject: xml validation on -- good idea or not?
> 
> 
> Hi,
> 
> Is it a good idea to run with xmlValidation="true" in server.xml?
> 
> I had this on for a while, but then it mysteriously stopped working --
> the container could no longer validate DTDs, refused to load webapps,
> etc.
> 
> What does xmlValidation="true" actually do?
> 
> I am using Tomcat 5.5.23.
> 
> - Julian
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Hotmail® has a new way to see what's up with your friends.
http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutorial_WhatsNew1_052009