Hi,
When I tried to build a list using the XPathDirectoryGenerator (Cocoon
2.1.3) I noticed two things:
1. I was unable to retrieve attributes from the root element
2. the filter on .xml files doesn't work
Re 1:
This is the snippet from the sitemap:
<map:match pattern="formlist">
<map:generate type="xpathdirectory" src="system/xmlforms">
<map:parameter name="xpath" value="/form/label |
/form/code"/>
<map:parameter name="xmlFiles" value="xml$"/>
</map:generate>
<map:transform src="system/formlist.xsl"/>
<map:serialize type="xml"/>
</map:match>
This is the original XML that had to be parsed (e.g. form1.xml):
<form @code="bla" @label="blabla in Dutch">
.....
</form>
I tried adding @ to the xpath parameter (value="/form/@label | /form/@code")
and it didn't work. Finally I changed the XML code to:
<form>
<code>bla</code>
<label>blabla in Dutch</label>
.....
</form>
And then it worked as described above. I also noticed that I got different
results when defining a DTD (DOCTYPE instruction) in the XML file or not.
With DOCTYPE the code works as expected, without DOCTYPE nothing was
retrieved. Of course I started out with the correct DTD for the original
description.
Re 2: Because I need the DTD I have a .dtd file in the system/xmlforms
directory. Although I followed all examples on the XPathDirectoryGenerator
where they define the xmlFiles parameter, I still noticed that the form.dtd
file was parsed (with no result). To be specific: I have 11 XML files and 1
DTD file in the directory. The result of the pipeline was 12 lines, one with
no information.
I finally build a workaround to check on the file extension in my
formlist.xsl, but that shouldn't be necessary.
Did I stumble onto a bug or have I missed an option I should have set
somewhere?
Bye,
Helma van der Linden
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]