lenya-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gringinho <gringi...@gmail.com>
Subject [2.0.1] XML namespace prefix confusion in LenyaMetaDataGenerator.java for the Collections module and MetaDataTransformer.java xmlns URI oddity
Date Fri, 18 Apr 2008 12:31:29 GMT
Hi,

I was wondering about the usage of namespace prefixes.
I see that the xmlns:lenya prefix is used mostly for the lenya/page-envelope
URI,
although it's used for other namespace URIs somewhere as well.

However, one place the setting of the prefix has some (undesired?)
consequences ...
For collections, the metadata is gatherhed with the LenyMetaDataGenerator
via the lenyaMetaData type, and included in the collection2include.xsl .

The essential part of the problem is that the URI namespace which in every
single XSL stylesheet in Lenya has the prefix xmlns:meta - now get's another
prefix - namely xmlns:lenya .
This seems quite odd, regarding that the xmlns:lenya prefix is normally
associated
with the page-envelope URI, with some XSL stylesheets exceptions.

What excacerbates the problem is that the prefix is not stripped from the
resulting
nodeset/structure either. So, it's delivered as
collection/col:document/lenya:metadata

Where the collection element is of URI normally using the xmlns:col prefix,
as is col:document - with the prefix intact - unlike the parent collection
element.
The lenya:metadata element has the URI almost(!) *always* prefixed with
xmlns:meta
in the XSL stylesheets. Then the children of the lenya:metadata element have
their prefixes stripped, and are a mix of URIs.

Now, in pubs/default/xslt/page2xhtml.xsl there are different prefixes used
as well.
xmlns:meta="http://apache.org/lenya/meta/1.0/"
xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"

Remember that the xmlns:lenya prefix is set in LenyMetaDataGenerator.java as
"http://apache.org/cocoon/lenya/metadata/1.0" .

Therefore we end up with the following when wanting to style pages, and
include
a collection of documents using (aggregated with) the Collections module:
 * a collection structure where the lenya:metadata element is prefixed but
with the
   normal metadata URI which almost always is prefixed as meta:metadata .
 * a page2xhtml.xsl stylesheet which already sets the xmlns:lenya prefix to
   the (mostly) normal page-envelope URI.



Needless to say, this creates a little confusion when trying to style pages.
Can I suggest that the lenya:metadata prefix is dropped from
LenyaMetaDataGenerator.java ,
or that a more appropriate meta:metadata prefix is used ?

Secondly - the xmlns:meta URI used in the standard page2xhtml.xsl is
different
from the normal xmlns:meta="http://apache.org/cocoon/lenya/metadata/1.0"
used in other stylesheets around Lenya.

The only places that the URI http://apache.org/lenya/meta/1.0/ is
mentioned are in
MetaDataTransformer.java
pubs/default/sitemap.xmap
pubs/default/xslt/page2xhtml.xsl

Everywhere else the metadata element and xmlns:meta prefix are all
associated with
the URI http://apache.org/cocoon/lenya/metadata/1.0 .

I can therefore only assume that it is the wrong URI used in these three
instances
mentioned right above for the sitemap, page2xhtml and MetaDataTransformer.
It certainly creates some confusion.
While, the lenya:metadata prefix left in via the Collections module makes it
impossible to use parts of the hierarchy because of mismatching prefixes and
URIs.


Well, hope someone gets some help from the findings I made, and are not
hitting their heads on the wall so to speak, like I did for some hours.

Cheers,
Gringinho

Mime
View raw message