On 6/18/07, Vaduvoiu Tiberiu <[EMAIL PROTECTED]> wrote:
My site has some categories. Some categories have subcategories. And here is the part in sitemap where I have my problem <map:match pattern="*/*/*/*/"> <map:aggregate element="root" label="source"> <map:part element="menu" src="cocoon:/{1}/menu.xml"/> <map:part element="menu2" src="cocoon:/{1}/{2}/menu.xml"/> <map:part element="menu3" src="cocoon:/{1}/{2}/{3}/menu.xml"/> <map:part element="document" src="cocoon:/{1}/{2}/{3}/{4}/index.xml"/> <map:part element="menu4" src="cocoon:/{1}/{2}/{3}/{4}/menu.xml"/>so here's the catch. mysite.com/A/B/C/D has some subcategories(D/x) mysite.com/A/B/C/E doesn't have subcategories So when I load the /D url, everything works fine because the element menu4 exists.(there is a menu.xml in A/B/C/D folder) when I load the /E url, I get http resource not found error because there is no menu4 element(there is no menu.xml in A/B/C/E folder. So how can I make this "optional"? How can I tell cocoon "hey, if you don't find the menu4 element, it's no problem, just go on?"
Your "problem" is in the approach. Solutions: 1. Use single menu.xml. Why do you need a menu.xml in every directory? That sounds unnecessarily complicated. 2. Use an XPathDirectoryGenerator http://cocoon.apache.org/2.1/userdocs/xpathdirectory-generator.html This Generator merges XML files. Configure the starting directory, filter on filename menu.xml, and set the depth higher than the number of levels of subcategories (I use 99.) If menu.xml is just tracking other files, you could use the XPathDirectoryGenerator to dynamically create the menu so menu.xml is not needed. Either way, use XSL to remove extra information. Pass the desired path as a parameter to the XSLT so you can remove entries from other paths. solprovider --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
