cancel
Showing results for 
Search instead for 
Did you mean: 

Recursive file listings in XSL-transformations

pyppe
Champ in-the-making
Champ in-the-making
Hi.

By default, Alfresco WCM offers alfSmiley TonguearseXMLDocuments(formName, avmPath) function to be used within XSL-transformations. Apparently parseXMLDocuments function is a method of class org.alfresco.web.forms.FormDataFunctions. Is there an elegant way of extending this class to make it recursive, and enabling it to be used in XSL-transformations (without modifying the class directly)?

What I'd like to do is that every time a WCM-object is created/modified Alfresco would create an index-file containing all the elements of that type by using an XSL template. But we are planning an approach where WCM-objects are not necessarily in the same directory.

Another solution would be to execute a webscript from the XSL (which would recursive go through all the files). But is it possible to call a webscript from XSL. With XSD this is possible, but when I tried the same method in XSL (<xsl:value-of select="webscript://project/load-content-recursively/get?storeid={storeid}&amp;ticket={ticket}&amp;form=wcmType" />), I get the following Exception:

javax.xml.transform.TransformerException: org.apache.xpath.domapi.XPathStylesheetDOM3Exception: Prefix must resolve to a namespace: webscript

Any tips/suggestions? Thanks!

- Pyppe
1 REPLY 1

rogerp
Champ in-the-making
Champ in-the-making
The bit in the XSLT select clause is XPath, which expects axis::node-path[predicate]. The URL you've given has an unknown protocol "webscript", which I think XPath is trying to interpret as a namespace qualifier such as in webscript:thisElement. I think that's why it's confused.

My two cents worth.