Re: [Xsltforms-support] namespace in instance causing error
Brought to you by:
alain-couthures
From: Paul K. <pa...@xm...> - 2009-12-01 18:04:11
|
On 2009-11-28, at 9:14 AM, COUTHURES Alain wrote: >> Are you able to reproduce based on that second corrected code I sent, Alain? >> >> > No, I can't reproduce that... > > Can you test on another machine ? Tested outside of eXist stright thru xsltproc and xalan and the output is fine -- no truncation. Further testing with eXist points to XSLTServlet when called from a urlrewrite controller. In fact, it you pass it thru XSLTServlet twice you lose TWO characters off the left-side name of the element i.e. "newsml:newsItem" becomes "news:newsItem". Did you run it through the eXist xforms setup? Here are the two controller snippets I tested with (filename = namespace-in-instance.xml): One char truncation: else if (ends-with($exist:resource, '.xml')) then let $relPath := '../' return <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> <view> <forward servlet="XSLTServlet"> (: Apply xsltforms.xsl stylesheet :) <set-attribute name="xslt.stylesheet" value="{$relPath}xforms/xsltforms/xsltforms.xsl"/> <set-attribute name="xslt.output.omit-xml-declaration" value="yes"/> <set-attribute name="xslt.output.indent" value="no"/> <set-attribute name="xslt.output.media-type" value="text/html"/> <set-attribute name="xslt.output.method" value="xhtml"/> <set-attribute name="xslt.baseuri" value="{$relPath}xforms/xsltforms/"/> </forward> </view> <cache-control cache="yes"/> </dispatch> Two char truncation: else if ($exist:resource = ('todo-list.xml', 'shakespeare.xml', 'namespace-in-instance.xml')) then let $relPath := if ($exist:resource eq 'todo-list.xml') then '../' else '' return <dispatch xmlns="http://exist.sourceforge.net/NS/exist"> <view> <forward servlet="XSLTServlet"> <set-attribute name="xslt.stylesheet" value="{$exist:root}/stylesheets/db2xhtml.xsl"/> <set-attribute name="xslt.syntax-highlight" value="no"/> </forward> <forward servlet="XSLTServlet"> (: Apply xsltforms.xsl stylesheet :) <set-attribute name="xslt.stylesheet" value="{$relPath}xsltforms/xsltforms.xsl"/> <set-attribute name="xslt.output.omit-xml-declaration" value="yes"/> <set-attribute name="xslt.output.indent" value="no"/> <set-attribute name="xslt.output.media-type" value="text/html"/> <set-attribute name="xslt.output.method" value="xhtml"/> <set-attribute name="xslt.baseuri" value="{$relPath}xsltforms/"/> </forward> </view> <cache-control cache="yes"/> </dispatch> |