Dear Cocooners, Running Cocoon 2.1.2, we have the following XSP page:
<?xml version="1.0" encoding="UTF-8"?> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"> <select-page> <entity>Ethnologue Country</entity> <list role="instances"> <sil:query connection="ethnolog" row-element="link" xmlns:sil="http://www.sil.org/namespace/xsp-query">SELECT Ethnologue_Country_Id id, Ethnologue_Country_Lb label FROM Ethnologue_Country_admin WHERE Parent_Id IS NULL</sil:query> </list> </select-page> </xsp:page> This page uses the "sil" logicsheet, declared in cocoon.xconf. When used as above, the SIL logicsheet does not seem to get invoked; the output of the page is the same as its content, except that xsp:page is removed: <select-page> <entity>Ethnologue Country</entity> <list role="instances"> <sil:query connection="ethnolog" row-element="link" xmlns:sil="http://www.sil.org/namespace/xsp-query">SELECT Ethnologue_Country_Id id, Ethnologue_Country_Lb label FROM Ethnologue_Country_admin WHERE Parent_Id IS NULL</sil:query> </list> </select-page> However, if I move the sil namespace declaration from the sil:query element to the xsp:page element, as follows: <?xml version="1.0" encoding="UTF-8"?> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp" xmlns:sil="http://www.sil.org/namespace/xsp-query"> <select-page> <entity>Ethnologue Country</entity> <list role="instances"> <sil:query connection="ethnolog" row-element="link">SELECT Ethnologue_Country_Id id, Ethnologue_Country_Lb label FROM Ethnologue_Country_admin WHERE Parent_Id IS NULL</sil:query> </list> </select-page> </xsp:page> then the XSP page works, producing data such as <select-page> <entity>Ethnologue Country</entity> <list role="instances"> <link> <ID>35</ID> <LABEL>Cambodia</LABEL> </link> ... ! If I'm not mistaken, the above change shouldn't make any difference to a namespace-aware XML application; no element is in a different namespace than it was before. Nevertheless this seems to be making a crucial difference to the logicsheet processor. This is significant because this XSP page is generated by a stylesheet; it's not very easy to force the generated code to have the sil namespace declaration on the xsp:page element rather than on the sil:query element, since the latter is the only place it's needed. Am I missing something, or is this indeed a bug? Thanks, Lars P.S. The logicsheet begins like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsp="http://apache.org/xsp" xmlns:sil="http://www.sil.org/namespace/xsp-query" xmlns:esql="http://apache.org/cocoon/SQL/v2"> <xsl:output indent="yes" method="xml" /> <xsl:template match="sil:query"> so this template should match any <sil:query> that's in the right namespace, regardless of whether the namespace declaration occurs on the <sil:query> element itself, or an ancestor. (In fact the XSL processor shouldn't even know the difference!) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
