11 Replies Latest reply on Feb 25, 2007 10:43 PM by H K

    Schema and DTD validation

    Carsten Hoehne Master

      Hello,
      some hints
      My favorite IDE validates xml files based upon schemas or dtds.
      Seam has such files:

      components.xml
      pages.xml

      They do include an url which points to
      http://jboss.com/products/seam/....
      Unfortunately the DTDs and schemas are not up to date. Gavin knows about this fact. He searches for a good updating process. Any Ideas?

      This means that validating the mentioned files will fail.
      In my case, i could register the correct xsd and dtd files in a xml catalog for my ide. So the validating process will use my local copys.

      The xsd files can be found only in the cvs at the moment. With the next seam release they will be delivered. The pages-1.1.dtd is part of seam1.1.6,yet.
      Ciao,
      Carsten



        • 1. Re: Schema and DTD validation
          Gavin King Master

          What do you mean?! The XSDs and DTDs are available at those URLs, and are uptodate with 1.1.6.

          They aren't uptodate with CVS, of course...

          • 2. Re: Schema and DTD validation
            Carsten Hoehne Master

            I am using seam 1.1.6 not the cvs version. But i am using the schemas and dtds out of cvs.

            In the seamspace example the pages.xml contains this:

            <pages....
             <exception class="org.jboss.seam.security.NotLoggedInException">
             <end-conversation/>
             <redirect view-id="/register.xhtml">
             <message>You must be a member to use this feature</message>
             </redirect>
             </exception>
            
             <exception class="org.jboss.seam.security.AuthorizationException">
             <end-conversation/>
             <redirect view-id="/security_error.xhtml">
             <message>You do not have permission to do this</message>
             </redirect>
             </exception>
            </pages>
            

            i got validating errors on the pages tag. After switching to my local copy of the dtd the error vanished.
            Same with components.xml. I tried to enter an event in this file. But no code completion was possible. After entering the event, i got an validation error. Only switching to my local copy of the components.xsd helps.
            So for me, i can not use the file at those URLS.
            The intention for this post was to make this fact public. So that other people do not start wondering what is going wrong.


            • 3. Re: Schema and DTD validation
              Gavin King Master

               

              I am using seam 1.1.6 not the cvs version. But i am using the schemas and dtds out of cvs.


              You should not be using the CVS DTDs/XSDs with 1.1.6. For 1.1.6, the versions on the websites are the correct ones, and they will provide correct validation and autocomplete in eclipse (I use it every day).


              • 4. Re: Schema and DTD validation
                jk;l jkl; Expert

                I had this problem before as well...if you're using one version of Seam, but the DTD on the site is for a different version, your IDE will give you trouble.

                Why not version the DTD at the level of granularity of releases (i.e. pages-1.1.5.dtd)? Then when you're using a given version of Seam or pages.xml, you update your DOCTYPE accordingly.

                For example, the people using 1.1.0 today will get IDE errors. I dunno, just my suggestion anyways...

                • 5. Re: Schema and DTD validation
                  Carsten Hoehne Master

                  Yes, seems to be an eclipse/exadel problem.
                  I validated my files using xmlspy and the external DTDs and schemas. All is well. But eclipse throws errors again:-(

                  Please also take a look here:
                  http://forum.exadel.com/viewtopic.php?p=17749#17749
                  Ciao,
                  Carsten

                  • 6. Re: Schema and DTD validation
                    Gavin King Master

                     

                    Yes, seems to be an eclipse/exadel problem.


                    Turn off schema caching in eclipse.

                    • 7. Re: Schema and DTD validation
                      Gavin King Master

                       

                      "lightbulb432" wrote:
                      I had this problem before as well...if you're using one version of Seam, but the DTD on the site is for a different version, your IDE will give you trouble.

                      Why not version the DTD at the level of granularity of releases (i.e. pages-1.1.5.dtd)? Then when you're using a given version of Seam or pages.xml, you update your DOCTYPE accordingly.

                      For example, the people using 1.1.0 today will get IDE errors. I dunno, just my suggestion anyways...


                      We don't usually break the schema between point releases (not unless the schema had an error in it). We just add new stuff.

                      We don't want to force people to change all their schema declarations every time we do a point release. That would be nuts.

                      • 8. Re: Schema and DTD validation
                        Carsten Hoehne Master

                        One point more:
                        I have this in component.xml

                        <framework:hibernate-entity-query name="myUserList"
                         ejbql="from User"
                         max-results="5"
                         order="login"
                         session="#{bazDatabase}" />
                        

                        and i get with eclipse this
                        cvc-complex-type.3.2.2: Attribute 'ejbql' is not allowed to appear in element 'framework:hibernate-
                        entity-query'.

                        XMLSpy does not complain with the same file. There is definitly something wrong with eclipse.

                        • 9. Re: Schema and DTD validation
                          Gus Gu Expert

                           

                          "gavin.king@jboss.com" wrote:
                          Turn off schema caching in eclipse.


                          Hi Gavin, could you please detail where to turn off schema caching in eclipse? I got the same problem after upgrading to Seam 1.1.6. I use eclipse+exadel. Thank you.

                          • 10. Re: Schema and DTD validation
                            Carsten Hoehne Master

                            I do not know if this is the correct way to do it. But i have not found a way to only deactivate schema caching.

                            Prreferences/Internet/Cache and check Disable caching

                            Do not forget to remove the cached files for Jboss Seam.

                            • 11. pages DTD for 1.1.7RC1
                              H K Newbie

                              Hello everybody,

                              When do the DTDs usually get updated? GA only?

                              As of 1.1.7RC1, pages-1.1.dtd is missing the login-required and login-view-id attributes.

                              (http://jboss.com/products/seam/pages-1.1.dtd)