You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Piroumian Konstantin <KP...@protek.com> on 2002/06/06 18:34:08 UTC

[INFO] Sitemap XML Schema is available

Folks,

The long awaited first draft of the Sitemap XML Schema is now available from
CVS (HEAD branch).

Currently, it correctly validates most of the Cocoon sitemaps (root,
samples, mod-db, portal, several samples). I've also used it to write a
sitemap in XML Spy and jEdit and I could at least see what are the possible
attributes.

Though, it's not yet perfect and does not perform strict validation for some
parts (e.g. pipeline content), so I'll need help from Schema gurus and
sitemap wizards to make it better.

After it will be cleaned up/improved to perform better validation of the
pipelines, I am going to add more strict rules, e.g. uniqueness checks on
component names, pattern and enumeration restrictions, etc. everywhere it
can be useful.

Please, try it and tell me what else can be added/improved and patch it at
will.

Konstantin

_________________________________________
Konstantin Piroumian
Lead Developer

Email: kpiroumian@apache.org
ICQ#: 2297575
* Work Tel#:  +7 095 795 0520 * 1288
* More ways to contact me <http://web.icq.com/wwp?Uin=2297575> 
i See more about me <http://kot-p.hotbox.ru/> 
_________________________________________



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [INFO] Sitemap XML Schema is available

Posted by Ivelin Ivanov <iv...@apache.org>.
Hm, good point.

I was speaking from experience.
A strong validating XML Schema can go a long way in saving the processor
validating logic headaches.
I find XML Schema the right choice in this instance since it allows rigorous
structure check and the sitemap is a static document which is either valid
or not.


Ivelin


----- Original Message -----
From: "David Crossley" <cr...@indexgeo.com.au>
To: <co...@xml.apache.org>
Sent: Friday, June 07, 2002 12:30 AM
Subject: Re: [INFO] Sitemap XML Schema is available


> Ivelin Ivanov wrote:
> >
> > Cool.
> >
> > Have you tried referencing the Schema from within the sitemap files, so
that
> > the transformer (actually the parser it uses) validates them before
> > processing?
>
> That would be good if you can do it. However, beware of
>  http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6200
>  Parser failure with validate=true when processing stylesheet
>
> You would also need a mapping entry in the OASIS catalog
> src/webapp/resources/entities/catalog
>
> --David
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [INFO] Sitemap XML Schema is available

Posted by David Crossley <cr...@indexgeo.com.au>.
Ivelin Ivanov wrote:
> 
> Cool.
> 
> Have you tried referencing the Schema from within the sitemap files, so that
> the transformer (actually the parser it uses) validates them before
> processing?

That would be good if you can do it. However, beware of
 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6200
 Parser failure with validate=true when processing stylesheet

You would also need a mapping entry in the OASIS catalog
src/webapp/resources/entities/catalog

--David



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [INFO] Sitemap XML Schema is available

Posted by Ivelin Ivanov <iv...@apache.org>.
Cool.

Have you tried referencing the Schema from within the sitemap files, so that
the transformer (actually the parser it uses) validates them before
processing?



----- Original Message -----
From: "Piroumian Konstantin" <KP...@protek.com>
To: <co...@xml.apache.org>
Cc: <co...@xml.apache.org>
Sent: Thursday, June 06, 2002 11:34 AM
Subject: [INFO] Sitemap XML Schema is available


> Folks,
>
> The long awaited first draft of the Sitemap XML Schema is now available
from
> CVS (HEAD branch).
>
> Currently, it correctly validates most of the Cocoon sitemaps (root,
> samples, mod-db, portal, several samples). I've also used it to write a
> sitemap in XML Spy and jEdit and I could at least see what are the
possible
> attributes.
>
> Though, it's not yet perfect and does not perform strict validation for
some
> parts (e.g. pipeline content), so I'll need help from Schema gurus and
> sitemap wizards to make it better.
>
> After it will be cleaned up/improved to perform better validation of the
> pipelines, I am going to add more strict rules, e.g. uniqueness checks on
> component names, pattern and enumeration restrictions, etc. everywhere it
> can be useful.
>
> Please, try it and tell me what else can be added/improved and patch it at
> will.
>
> Konstantin
>
> _________________________________________
> Konstantin Piroumian
> Lead Developer
>
> Email: kpiroumian@apache.org
> ICQ#: 2297575
> * Work Tel#:  +7 095 795 0520 * 1288
> * More ways to contact me <http://web.icq.com/wwp?Uin=2297575>
> i See more about me <http://kot-p.hotbox.ru/>
> _________________________________________
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [INFO] Sitemap XML Schema is available

Posted by Bruno Dumon <br...@outerthought.org>.
On Thu, 2002-06-06 at 18:34, Piroumian Konstantin wrote:
[snip]
> 
> Please, try it and tell me what else can be added/improved and patch it at
> will.
> 

Sorry for the late response, but hey, it's better late than nothing :-)

I tried out your schema with Xerces 2.01 on a sitemap I have here (that
works with cocoon 2.02).

Some errors I found in the schema:

* Additional configuration attributes and child elements on the
component declarations are apparently not allowed by the schema.
e.g. <map:transformer name="foo" src="a.b.c.d.FooImpl" foo-factor="5"/>


* Giving parameters to a selector is not allowed by the schema:
e.g.
  <map:select>
     <map:parameter name="foo" value="bar"/>
     [...]
  </map:select>

Also, with current sitemap implementations the parameters may be
anywhere as long as they're a child of the parent element:

e.g.
<map:select>
  <map:parameter name="..." value="..."/>
  <map:when ... </map:when>
  <map:parameter name="..." value="..."/>
  <map:when ... </map:when>
</map:select>

Although this kind of usage should probably be discouraged ;-)


* Everywhere the data type xs:anyURI is required, this should be removed
because in the sitemap you may use {param} things in these attributes,
and that are not valid URI's.
e.g. <map:redirect-to uri="{page}"/>

Some missing attributes:
 * src and set on map:act
 * session on map:redirect-to
 * language on map:mount
 * strip-root and prefix on map:part

 * map:mount is a strange case: in the sitemap.xsl (C2.02) there is
'reload-method' attribute with values 'synchron' and 'asynchron',
however that attribute is not used by the treeprocessor (as far as I can
see).



Then some errors that are a consequence of trying to formalize the
content model of the pipeline elements, which I have always found quite
difficult because just about any combination of elements is allowed.
Here are some examples of what does not work:

* content starting with map:transform is not allowed by the schema, e.g.
        <map:pipeline>
            <map:select>
                <map:when>
                    <map:act type="hello">
                        <map:generate/>
                    </map:act>
                    <map:transform type="x"/>
                    <map:serialize/>
                </map:when>
            </map:select>
        </map:pipeline>


* stuff before <map:redirect-to> is not allowed by the schema:
        <map:pipeline>
            <map:act/>
            <map:redirect-to uri="http://www.somewhere.be"/>
        </map:pipeline>

* A map:serialize on its own is not allowed by the schema:

        <map:pipeline>
            <map:select>
                <map:when test="...">
                    <map:generate/>
                    <map:transform/>
                </map:when>
            </map:select>
            <map:serialize/>
        </map:pipeline>



Finally, here are the errors in the schema itself as reported by Xerces:

[Error] sitemap-2.1-draft.xsd:308:41: Error:  The child 'choice' of the
named group definition 'indirectComponents' must not specify either the
minOccurs or maxOccurs attribute.
[Error] sitemap-2.1-draft.xsd:205:76: p-props-correct.2.1: {min occurs}
= '1' must not be greater than {max occurs} = '0' for 'group'.
[Error] sitemap-2.1-draft.xsd:206:77: p-props-correct.2.1: {min occurs}
= '1' must not be greater than {max occurs} = '0' for 'group'.
[Error] sitemap-2.1-draft.xsd:204:28: derivation-ok-restriction.5.2:
Error for type 'noGenerationPipelineType'.  The content type of this
type is empty, but the content type of the base is not.
[Error] sitemap-2.1-draft.xsd:190:30: cos-ct-extends.1.4.2.2.2.2.1:
Error for type 'viewType'.  The content type of a derived type and that
of its base must both be mixed or element-only.
[Error] sitemap-2.1-draft.xsd:359:30: cos-ct-extends.1.4.2.2.2.2.1:
Error for type 'handle-errorsType'.  The content type of a derived type
and that of its base must both be mixed or element-only.
[Error] sitemap-2.1-draft.xsd:330:49: s4s-att-not-allowed: Attribute
'name' cannot appear in element 'complexType'.
[Error] sitemap-2.1-draft.xsd:421:33: cos-nonambig:
("http://apache.org/cocoon/sitemap/1.0":call) and
("http://apache.org/cocoon/sitemap/1.0":call){0-UNBOUNDED} (or elements
from their substitution group) violate "Unique Particle Attribution".
[Error] sitemap-2.1-draft.xsd:393:41: cos-nonambig:
("http://apache.org/cocoon/sitemap/1.0":call) and
("http://apache.org/cocoon/sitemap/1.0":call){0-UNBOUNDED} (or elements
from their substitution group) violate "Unique Particle Attribution".
[Error] sitemap-2.1-draft.xsd:373:38: cos-nonambig:
("http://apache.org/cocoon/sitemap/1.0":call) and
("http://apache.org/cocoon/sitemap/1.0":call){0-UNBOUNDED} (or elements
from their substitution group) violate "Unique Particle Attribution".
[Error] sitemap-2.1-draft.xsd:317:36: cos-nonambig:
("http://apache.org/cocoon/sitemap/1.0":parameter){0-UNBOUNDED} and
("http://apache.org/cocoon/sitemap/1.0":parameter){0-UNBOUNDED} (or
elements from their substitution group) violate "Unique Particle
Attribution".
[Error] sitemap-2.1-draft.xsd:201:53: cos-particle-restrict.2: Forbidden
particle restriction:  'any:choice,sequence,all,elt'.
[Error] sitemap-2.1-draft.xsd:201:53: derivation-ok-restriction.5.3:
Error for type 'noGenerationPipelineType'.  The particle of the type is
not a valid restriction of the particle of the base.
[Error] sitemap-2.1-draft.xsd:173:41: cos-nonambig:
("http://apache.org/cocoon/sitemap/1.0":call) and
("http://apache.org/cocoon/sitemap/1.0":call){0-UNBOUNDED} (or elements
from their substitution group) violate "Unique Particle Attribution".
[Error] sitemap-2.1-draft.xsd:243:48: cos-nonambig:
("http://apache.org/cocoon/sitemap/1.0":call) and
("http://apache.org/cocoon/sitemap/1.0":call){0-UNBOUNDED} (or elements
from their substitution group) violate "Unique Particle Attribution".


That's all.

I'm not an xml schema guru myself (who is?), but maybe someone else can
do something usefull with this.

--
Bruno Dumon


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org