On 8/23/05, Alexandre Poitras <[EMAIL PROTECTED]> wrote: > I have another question. For a part of the website I am > currently building, I was juggling with the idea of putting all the > content directly into a single xml file or to split it in logical > units each one mapped to it own single xml file and aggregate then > with the help of the xinclude transformer. For instance, say I have a > serie of articles. I could put all the articles in one single fat xml > file. Or I could define each article in it own xml file and write a > xml file that aggregate them all with the help of the xinclude > technology. > > So my question is first what is the state of the xinclude transformer? > In the wiki it is written it is not yet compatible with the publishing > mechanism of Lenya, so is it still true? And finally what do you think > is the best approach? Thanks in advance for all the tips!
I have not tried the "includes". (I thought it was 'c', not 'x'). They seem like GOTOs, making it easy to write spaghetti code. Have you seen the XpathDirectory Generator? http://cocoon.apache.org/2.1/userdocs/generators/xpathdirectory-generator.html You must also read: http://cocoon.apache.org/2.1/userdocs/generators/directory-generator.html for most of the configuration options. You could aggregate your entire publication using it. I just did that for a Newsletter function. A few comments: - There is no method to disable "depth". The default "1" returns a single directory. "0" returns nothing. I set it to "99"; the OS should break before we hit that limit. - The xpath parameter does not understand namespaces. If you want: <map:parameter name="xpath" value="/xhtml:html'/lenya:meta/dc:title"/> You need to use: <map:parameter name="xpath" value="/*[local-name()='html']/*[local-name()='meta']/*[local-name()='title']"/> This makes the value very long, especially if you want more than one field. The field separator is the pipe '|'. - The XML returned is a mess. The XPath is included in every entry, when it should be in a confiuration section, and you probably do not want it at all. You will want an XSLT to turn the results into something usable before the usual XSLT to make the results displayable. The structure is: dir:directory/dir:file/dir:xpath/{your fields} The namespaces (that couldn't be configured in the last comment) will show in the results, so the example would match: dir:directory/dir:file/dir:xpath/dc:title Make certain to copy the appropriate namespace headers to your XSLTs. solprovider --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
