Hi,
coud someone look at the short attached page and let me know why it doesn't not work when I have the level-2 nested repeat? What is the XForms error "repeatChildren and newNodeset have different sizes" Case #1 - load the page, click on the Del button for row 1 in the top table --> works fine - load the page, click on the Del button for row 2 in the top table --> XForms error: repeatChildren and newNodeset have different sizes. Case #2 (remove level-2 repeat at end of code, see marked section) - load the page, click on the Del button for row 1 of top table --> works fine - load the page, click on the Del button for row 2 of top table --> works fine I have a more complex case with 3 or 4 nested repeat but need to solve this one first.... I'm running OPS 3 Beta 4. Any suggestion would be appreciated. many thanks Pascal -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws test-nested-repeat.xhtml (5K) Download Attachment |
Hi Pascal,
I had a similar problem earlier. While I am still relatively new to all of this, you could try this: - You have a typo on the level 2 repeat, you have: is="level-2-repeat", change it to id="level-2-repeat". - For whatever reason, I ended up having to reference the whole path on some of my nested repeats, so you could try changing your ref to: <xforms:repeat id="level-2-repeat" nodeset="instance('instance')/level-1/level-2"> Again, I am new to this, but I thought I would share what has worked for me in the past. - Dan -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Dan:
thanks for your hep and for pointing out the typo :-) Tried to use a full XPath in the repeat: instance('instance')/level-1[index('level-1-repeat')]/level-2 but problem remained... I'm sure Erik will nail this one shortly. cheers, *P [hidden email] wrote: Hi Pascal, I had a similar problem earlier. While I am still relatively new to all of this, you could try this: - You have a typo on the level 2 repeat, you have: is="level-2-repeat", change it to id="level-2-repeat". - For whatever reason, I ended up having to reference the whole path on some of my nested repeats, so you could try changing your ref to: <xforms:repeat id="level-2-repeat" nodeset="instance('instance')/level-1/level-2"> Again, I am new to this, but I thought I would share what has worked for me in the past. - Dan -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Pascal Heus
Pascal,
Good catch! This bug (in fact I found 2 or 3 separate issues) is now fixed in CVS. Note that you make a somewhat incorrect use of the xforms:delete "at" attribute. You have something of the form: <xforms:repeat id="level-1-repeat" nodeset="level-1[position() < last()]"> ... <xforms:delete nodeset="." at="index('level-1-repeat')" ev:event="DOMActivate"/> Within an xforms:repeat iteration, the context node is always a single node corresponding to a particular node of the repeat nodeset. This is also true for your nested xforms:delete, which means that your xforms:delete nodeset evaluates also to a single node. This means that your "at" attribute should evaluate to "1" to delete the current row. However, with the above code, it evaluates to whatever the current index for the repeat is: 1 for deleting the first row, 2 for deleting the second, 3 for the third. But the index of the "at" attribute operates against the "nodeset" attribute of xforms:delete, which is a single node. So as per the XForm spec, unless your "at" attribute evaluates to 1, it is adjusted to be within the bounds of the node-set, that is, always 1. So you should replace the line with either: <xforms:delete nodeset="." at="1" ev:event="DOMActivate"/> or: <xforms:delete nodeset="../level-1[position() < last()]" at="index('level-1-repeat')" ev:event="DOMActivate"/> Besides this, your example looks good! We should include something like this in the list of OPS examples. -Erik Pascal Heus wrote: > Hi, > coud someone look at the short attached page and let me know why it > doesn't not work when I have the level-2 nested repeat? > What is the XForms error "repeatChildren and newNodeset have different > sizes" > > Case #1 > - load the page, click on the Del button for row 1 in the top table > --> works fine > - load the page, click on the Del button for row 2 in the top table > --> XForms error: repeatChildren and newNodeset have different sizes. > > Case #2 (remove level-2 repeat at end of code, see marked section) > - load the page, click on the Del button for row 1 of top table > --> works fine > - load the page, click on the Del button for row 2 of top table > --> works fine > > I have a more complex case with 3 or 4 nested repeat but need to solve > this one first.... > I'm running OPS 3 Beta 4. Any suggestion would be appreciated. > many thanks > Pascal -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Erik:
many thanks for the fix and the extended xforms:delete explanation, this may answer a few of the other problems I've been facing in more complex nested repeats conditions. Will pick up the latest CVS and see what happens. I'll gladly help documenting this, let me know which format I should use. cheers, Pascal Erik Bruchez wrote: Pascal, -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Erik Bruchez
Erik:
quick question: I usually download the release version of OPS and then import the .war file to use with the Studio plug-in under Eclipse. The CVS version does not seem to have the .war file in and is packaged quite differently. Do you have a any documentation on how it should be deploye/installe? Should I just sync with CVS under Eclipse and build from there? thanks *P Erik Bruchez wrote: Pascal, -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Pascal,
The CVS contains the source code. To build, you have to run the ant task, with build.bat or build.sh, and run the appropriate target, like "orbeon-war" to build an exploded WAR. But you can also get binary unstable builds here: http://forge.objectweb.org/nightlybuilds/ops/ops/ This way, you don't need to build. Of course we encourage people to try building from CVS, as that is the first step toward modifying the code yourself. -Erik Pascal Heus wrote: > Erik: > quick question: I usually download the release version of OPS and then > import the .war file to use with the Studio plug-in under Eclipse. The > CVS version does not seem to have the .war file in and is packaged quite > differently. Do you have a any documentation on how it should be > deploye/installe? Should I just sync with CVS under Eclipse and build > from there? > thanks > *P > > Erik Bruchez wrote: > >> Pascal, >> >> Good catch! This bug (in fact I found 2 or 3 separate issues) is now >> fixed in CVS. >> >> Note that you make a somewhat incorrect use of the xforms:delete "at" >> attribute. You have something of the form: >> >> <xforms:repeat id="level-1-repeat" nodeset="level-1[position() < >> last()]"> >> ... >> <xforms:delete nodeset="." at="index('level-1-repeat')" >> ev:event="DOMActivate"/> >> >> Within an xforms:repeat iteration, the context node is always a single >> node corresponding to a particular node of the repeat nodeset. This is >> also true for your nested xforms:delete, which means that your >> xforms:delete nodeset evaluates also to a single node. >> >> This means that your "at" attribute should evaluate to "1" to delete >> the current row. However, with the above code, it evaluates to >> whatever the current index for the repeat is: 1 for deleting the first >> row, 2 for deleting the second, 3 for the third. But the index of the >> "at" attribute operates against the "nodeset" attribute of >> xforms:delete, which is a single node. So as per the XForm spec, >> unless your "at" attribute evaluates to 1, it is adjusted to be within >> the bounds of the node-set, that is, always 1. So you should replace >> the line with either: >> >> <xforms:delete nodeset="." at="1" ev:event="DOMActivate"/> >> >> or: >> >> <xforms:delete nodeset="../level-1[position() < last()]" >> at="index('level-1-repeat')" ev:event="DOMActivate"/> >> >> Besides this, your example looks good! We should include something >> like this in the list of OPS examples. >> >> -Erik >> >> Pascal Heus wrote: >> > Hi, >> > coud someone look at the short attached page and let me know why it >> > doesn't not work when I have the level-2 nested repeat? >> > What is the XForms error "repeatChildren and newNodeset have different >> > sizes" >> > >> > Case #1 >> > - load the page, click on the Del button for row 1 in the top table >> > --> works fine >> > - load the page, click on the Del button for row 2 in the top table >> > --> XForms error: repeatChildren and newNodeset have different >> sizes. >> > >> > Case #2 (remove level-2 repeat at end of code, see marked section) >> > - load the page, click on the Del button for row 1 of top table >> > --> works fine >> > - load the page, click on the Del button for row 2 of top table >> > --> works fine >> > >> > I have a more complex case with 3 or 4 nested repeat but need to solve >> > this one first.... >> > I'm running OPS 3 Beta 4. Any suggestion would be appreciated. >> > many thanks >> > Pascal >> >> >>------------------------------------------------------------------------ >> >> >>-- >>You receive this message as a subscriber of the [hidden email] mailing list. >>To unsubscribe: mailto:[hidden email] >>For general help: mailto:[hidden email]?subject=help >>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >> >> > > > ------------------------------------------------------------------------ > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
I just synced with CVS and built the war file using Ant under Eclipse. All goes well until I hit the war-copy-descriptor section that makes use of a xalan specific nodeset() extension in the "comment" template of the descriptors/examples/web/web.xsl tranform. Since I endorse Saxon8 in my java environment, it doesn't find the Xalan extension and throws the error shown below. I therefore slightly ajusted the web.xsl file to detect if the XSL processor is "2.0" which can then simply access the node set without the need of the xalan extension function (file attached). Might be useful to other non-xalan / 2.0 developers. cheers, *P ======================================================================================== init: [echo] Building Orbeon PresentationServer 3.0.beta4.200512200958 prepare: war-copy-descriptors: [copy] Copying 11 files to C:\eclipse-workspace\orbeon\build\ops-war\WEB-INF [mkdir] Created dir: C:\eclipse-workspace\orbeon\build\ops-war\WEB-INF\exist-data [copy] Copying 1 file to C:\eclipse-workspace\orbeon\build\ops-war\WEB-INF\exist-data [echo] Target: devel [xslt] Processing C:\eclipse-workspace\orbeon\build.xml to C:\eclipse-workspace\orbeon\build\ops-war\WEB-INF\web.xml [xslt] Loading stylesheet C:\eclipse-workspace\orbeon\descriptors\examples\web\web.xsl [xslt] : Warning! Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor [xslt] C:/eclipse-workspace/orbeon/descriptors/examples/web/web.xsl:417: Fatal Error! Cannot find a matching 1-argument function named {http://xml.apache.org/xalan}nodeset() [xslt] Failed to process C:\eclipse-workspace\orbeon\build.xml BUILD FAILED C:\eclipse-workspace\orbeon\build.xml:658: The following error occurred while executing this line: C:\eclipse-workspace\orbeon\build.xml:337: Fatal error during transformation Total time: 1 minute 21 seconds ======================================================================================== UPDATED SECTION IN descriptors/examples/web/web.xsl Line 397: <xsl:template name="comment"> <xsl:param name="caption"/> <xsl:param name="commented"/> <xsl:param name="content"/> <xsl:comment> <xsl:text> Uncomment this for the </xsl:text> <xsl:value-of select="$caption"/> <xsl:text> </xsl:text> </xsl:comment> <xsl:choose> <xsl:when test="$commented"> <xsl:comment> <!-- begin customized section --> <xsl:choose> <xsl:when test="system-property('xsl:version') >= 2.0"> <xsl:for-each select="$content"> <xsl:call-template name="to-text"> <xsl:with-param name="node" select="."/> </xsl:call-template> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:for-each select="xalan:nodeset($content)/*"> <xsl:call-template name="to-text"> <xsl:with-param name="node" select="."/> </xsl:call-template> </xsl:for-each> </xsl:otherwise> </xsl:choose> <!-- end customized section --> </xsl:comment> </xsl:when> <!-- begin customized section --> <xsl:otherwise> <xsl:choose> <xsl:when test="system-property('xsl:version') >= 2.0"> <xsl:copy-of select="$content"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="xalan:nodeset($content)/*"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> <!-- end customized section --> </xsl:choose> <xsl:comment> <xsl:text> End </xsl:text> <xsl:value-of select="$caption"/> <xsl:text> </xsl:text> </xsl:comment> </xsl:template> Erik Bruchez wrote: Pascal, <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:xslt="http://xml.apache.org/xslt" exclude-result-prefixes="xalan xslt"> <!-- Target can be: devel, war, install --> <xsl:param name="target"/> <xsl:param name="build-root"/> <xsl:param name="version-number"/> <xsl:output method="xml" indent="yes" xslt:indent-amount="4" doctype-public="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" doctype-system="http://java.sun.com/dtd/web-app_2_3.dtd"/> <xsl:template match="/"> <web-app> <display-name>Orbeon PresentationServer <xsl:value-of select="$version-number"/></display-name> <description> Orbeon PresentationServer is an open-source J2EE-based platform used to build XML-centric web applications with standard technologies like XForms, XSLT, and XML pipelines. </description> <xsl:comment> Initialize resource manager </xsl:comment> <context-param> <param-name>oxf.resources.factory</param-name> <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value> </context-param> <xsl:comment>Web app. resource manager</xsl:comment> <context-param> <param-name>oxf.resources.webapp.rootdir</param-name> <param-value>/WEB-INF/resources</param-value> </context-param> <context-param> <xsl:choose> <xsl:when test="$target = 'devel'" > <param-name>oxf.resources.priority.3</param-name> </xsl:when> <xsl:otherwise> <param-name>oxf.resources.priority.1</param-name> </xsl:otherwise> </xsl:choose> <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory</param-value> </context-param> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'flat file resource manager'"/> <xsl:with-param name="commented" select="$target != 'devel'"/> <xsl:with-param name="content"> <context-param> <param-name>oxf.resources.filesystem.sandbox-directory</param-name> <param-value> <xsl:choose> <xsl:when test="$target = 'devel'"><xsl:value-of select="$build-root"/>/src/examples/web</xsl:when> <xsl:otherwise>C:/path/to/my/resources</xsl:otherwise> </xsl:choose> </param-value> </context-param> <context-param> <param-name>oxf.resources.priority.1</param-name> <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value> </context-param> </xsl:with-param> </xsl:call-template> <context-param> <param-name>oxf.resources.priority.2</param-name> <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value> </context-param> <xsl:comment> OXF Class Loader </xsl:comment> <context-param> <param-name>oxf.classloader.enable</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>oxf.classloader.ignore-packages</param-name> <param-value>java. javax. org.apache.log4j. org.xml. org.w3c.</param-value> </context-param> <xsl:comment> Set location of properties.xml (read by resource manager) </xsl:comment> <context-param> <param-name>oxf.properties</param-name> <param-value>oxf:/config/properties.xml</param-value> </context-param> <xsl:comment> Set XML Server configuration file </xsl:comment> <context-param> <param-name>oxf.xml-server.config</param-name> <param-value>oxf:/ops/xml-server/xml-server.xml</param-value> </context-param> <xsl:comment> Set context listener processors </xsl:comment> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'context listener processors'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <context-param> <param-name>oxf.context-initialized-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.context-initialized-processor.input.config</param-name> <param-value>oxf:/context/context-initialized.xpl</param-value> </context-param> <context-param> <param-name>oxf.context-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.context-destroyed-processor.input.config</param-name> <param-value>oxf:/context/context-destroyed.xpl</param-value> </context-param> </xsl:with-param> </xsl:call-template> <xsl:comment> Set session listener processors </xsl:comment> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'session listener processors'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <context-param> <param-name>oxf.session-created-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.session-created-processor.input.config</param-name> <param-value>oxf:/context/session-created.xpl</param-value> </context-param> <context-param> <param-name>oxf.session-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.session-destroyed-processor.input.config</param-name> <param-value>oxf:/context/session-destroyed.xpl</param-value> </context-param> </xsl:with-param> </xsl:call-template> <!-- JSF is disabled (may be re-enabled in a future release) --> <!-- <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'JSF example'"/> <xsl:with-param name="commented" select="$target = 'devel' or $target = 'war'"/> <xsl:with-param name="content"> <context-param> <param-name>saveStateInClient</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <filter> <filter-name>processor-filter</filter-name> <filter-class>org.orbeon.oxf.servlet.OPSServletFilter</filter-class> </filter> <filter-mapping> <filter-name>processor-filter</filter-name> <url-pattern>/faces/*</url-pattern> </filter-mapping> <listener> <listener-class>org.orbeon.faces.renderkit.ServletContextListener</listener-class> </listener> <listener> <listener-class>com.sun.faces.config.ConfigListener</listener-class> </listener> </xsl:with-param> </xsl:call-template> --> <xsl:comment> Set PresentationServer listeners </xsl:comment> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'listeners'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <listener> <listener-class>org.orbeon.oxf.webapp.OPSServletContextListener</listener-class> </listener> <listener> <listener-class>org.orbeon.oxf.webapp.OPSSessionListener</listener-class> </listener> </xsl:with-param> </xsl:call-template> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'XML Server'"/> <xsl:with-param name="commented" select="true()"/> <xsl:with-param name="content"> <listener> <listener-class>org.orbeon.oxf.xmlserver.ContextListener</listener-class> </listener> </xsl:with-param> </xsl:call-template> <servlet> <servlet-name>ops-main-servlet</servlet-name> <servlet-class>org.orbeon.oxf.servlet.OPSServlet</servlet-class> <xsl:comment> Set main processor </xsl:comment> <init-param> <param-name>oxf.main-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}page-flow</param-value> </init-param> <init-param> <param-name>oxf.main-processor.input.controller</param-name> <param-value>oxf:/page-flow.xml</param-value> </init-param> <xsl:comment> Set error processor </xsl:comment> <init-param> <param-name>oxf.error-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.error-processor.input.config</param-name> <param-value>oxf:/config/error.xpl</param-value> </init-param> <xsl:comment> Set initialization listener </xsl:comment> <init-param> <param-name>oxf.servlet-initialized-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.servlet-initialized-processor.input.config</param-name> <param-value>oxf:/context/servlet-initialized.xpl</param-value> </init-param> <xsl:comment> Set destruction listener </xsl:comment> <init-param> <param-name>oxf.servlet-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.servlet-destroyed-processor.input.config</param-name> <param-value>oxf:/context/servlet-destroyed.xpl</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>ops-xforms-server-servlet</servlet-name> <servlet-class>org.orbeon.oxf.servlet.OPSServlet</servlet-class> <xsl:comment> Set main processor </xsl:comment> <init-param> <param-name>oxf.main-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.main-processor.input.config</param-name> <param-value>oxf:/ops/xforms/xforms-server.xpl</param-value> </init-param> <xsl:comment> Set error processor </xsl:comment> <init-param> <param-name>oxf.error-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.error-processor.input.config</param-name> <param-value>oxf:/ops/xforms/xforms-server-error.xpl</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>display-chart-servlet</servlet-name> <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet> <servlet-name>struts-servlet</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>config/examples/struts/module</param-name> <param-value>/WEB-INF/struts-module.xml</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'SQL examples'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <servlet> <servlet-name>hsqldb-servlet</servlet-name> <servlet-class>org.hsqldb.Servlet</servlet-class> <init-param> <param-name>hsqldb.server.database</param-name> <param-value>orbeondb</param-value> </init-param> <load-on-startup>4</load-on-startup> </servlet> </xsl:with-param> </xsl:call-template> <!-- JSF is disabled (may be re-enabled in a future release) --> <!-- <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'JSF example'"/> <xsl:with-param name="commented" select="$target = 'devel' or $target = 'war'"/> <xsl:with-param name="content"> <servlet> <servlet-name>jsf</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>5</load-on-startup> </servlet> </xsl:with-param> </xsl:call-template> --> <servlet-mapping> <servlet-name>ops-main-servlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ops-xforms-server-servlet</servlet-name> <url-pattern>/xforms-server</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>struts-servlet</servlet-name> <url-pattern>/struts/*</url-pattern> </servlet-mapping> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'SQL examples'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <servlet-mapping> <servlet-name>hsqldb-servlet</servlet-name> <url-pattern>/db</url-pattern> </servlet-mapping> </xsl:with-param> </xsl:call-template> <servlet-mapping> <servlet-name>display-chart-servlet</servlet-name> <url-pattern>/chartDisplay</url-pattern> </servlet-mapping> <!-- JSF is disabled (may be re-enabled in a future release) --> <!-- <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'JSF example'"/> <xsl:with-param name="commented" select="$target = 'devel' or $target = 'war'"/> <xsl:with-param name="content"> <servlet-mapping> <servlet-name>jsf</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> </xsl:with-param> </xsl:call-template> --> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'SQL examples'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <resource-ref> <description>DataSource</description> <res-ref-name>jdbc/db</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </xsl:with-param> </xsl:call-template> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'authentication example'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <security-constraint> <web-resource-collection> <web-resource-name>Administration</web-resource-name> <url-pattern>/examples-standalone/authentication</url-pattern> </web-resource-collection> <auth-constraint> <role-name>administrator</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/examples-standalone/authentication/login</form-login-page> <form-error-page>/examples-standalone/authentication/login-error</form-error-page> </form-login-config> </login-config> <security-role> <role-name>administrator</role-name> </security-role> </xsl:with-param> </xsl:call-template> </web-app> </xsl:template> <xsl:template name="comment"> <xsl:param name="caption"/> <xsl:param name="commented"/> <xsl:param name="content"/> <xsl:comment> <xsl:text> Uncomment this for the </xsl:text> <xsl:value-of select="$caption"/> <xsl:text> </xsl:text> </xsl:comment> <xsl:choose> <xsl:when test="$commented"> <xsl:comment> <!-- begin customized section --> <xsl:choose> <xsl:when test="system-property('xsl:version') >= 2.0"> <xsl:for-each select="$content"> <xsl:call-template name="to-text"> <xsl:with-param name="node" select="."/> </xsl:call-template> </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:for-each select="xalan:nodeset($content)/*"> <xsl:call-template name="to-text"> <xsl:with-param name="node" select="."/> </xsl:call-template> </xsl:for-each> </xsl:otherwise> </xsl:choose> <!-- end customized section --> </xsl:comment> </xsl:when> <!-- begin customized section --> <xsl:otherwise> <xsl:choose> <xsl:when test="system-property('xsl:version') >= 2.0"> <xsl:copy-of select="$content"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="xalan:nodeset($content)/*"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> <!-- end customized section --> </xsl:choose> <xsl:comment> <xsl:text> End </xsl:text> <xsl:value-of select="$caption"/> <xsl:text> </xsl:text> </xsl:comment> </xsl:template> <xsl:template name="to-text"> <xsl:param name="node"/> <xsl:param name="level" select="1"/> <xsl:choose> <xsl:when test="name($node) != ''"> <xsl:text> </xsl:text> <xsl:call-template name="indent"> <xsl:with-param name="level" select="$level"/> </xsl:call-template> <xsl:text><</xsl:text> <xsl:value-of select="name($node)"/> <xsl:text>></xsl:text> <xsl:for-each select="$node/node()"> <xsl:call-template name="to-text"> <xsl:with-param name="node" select="."/> <xsl:with-param name="level" select="$level + 1"/> </xsl:call-template> </xsl:for-each> <xsl:if test="count($node/*) > 0"> <xsl:text> </xsl:text> <xsl:call-template name="indent"> <xsl:with-param name="level" select="$level"/> </xsl:call-template> </xsl:if> <xsl:text></</xsl:text> <xsl:value-of select="name($node)"/> <xsl:text>></xsl:text> </xsl:when> <xsl:otherwise> <xsl:value-of select="$node"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="indent"> <xsl:param name="level"/> <xsl:if test="$level > 0"> <xsl:text> </xsl:text> <xsl:call-template name="indent"> <xsl:with-param name="level" select="$level - 1"/> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Pascal,
Thanks for the feedback! However I am surprised that your test on the version works in case Saxon is in 1.0 mode (which it should be, with the version="1.0" attribute on the root element of the transformation). Did you have to set it to "2.0"? In which case this would still not get us to having a portable stylesheet between Xalan and Saxon. But there is maybe another way: use exsl:node-set(): http://www.exslt.org/exsl/functions/node-set/index.html This function is available in Saxon and Xalan as well. Can you try that with your Saxon build? I attach the modified version. In the meanwhile, I have already switched from xalan:nodeset() to exslt:node-set() in CVS. -Erik Pascal Heus wrote: > Erik: > I just synced with CVS and built the war file using Ant under Eclipse. > All goes well until I hit the war-copy-descriptor section that makes use > of a xalan specific nodeset() extension in the "comment" template of the > descriptors/examples/web/web.xsl tranform. Since I endorse Saxon8 in my > java environment, it doesn't find the Xalan extension and throws the > error shown below. I therefore slightly ajusted the web.xsl file to > detect if the XSL processor is "2.0" which can then simply access the > node set without the need of the xalan extension function (file > attached). Might be useful to other non-xalan / 2.0 developers. > cheers, > *P <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exslt="http://exslt.org/common" xmlns:xslt="http://xml.apache.org/xslt" exclude-result-prefixes="exsl xslt"> <!-- Target can be: devel, war, install --> <xsl:param name="target"/> <xsl:param name="build-root"/> <xsl:param name="version-number"/> <xsl:output method="xml" indent="yes" xslt:indent-amount="4" doctype-public="-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" doctype-system="http://java.sun.com/dtd/web-app_2_3.dtd"/> <xsl:template match="/"> <web-app> <display-name>Orbeon PresentationServer <xsl:value-of select="$version-number"/></display-name> <description> Orbeon PresentationServer is an open-source J2EE-based platform used to build XML-centric web applications with standard technologies like XForms, XSLT, and XML pipelines. </description> <xsl:comment> Initialize resource manager </xsl:comment> <context-param> <param-name>oxf.resources.factory</param-name> <param-value>org.orbeon.oxf.resources.PriorityResourceManagerFactory</param-value> </context-param> <xsl:comment>Web app. resource manager</xsl:comment> <context-param> <param-name>oxf.resources.webapp.rootdir</param-name> <param-value>/WEB-INF/resources</param-value> </context-param> <context-param> <xsl:choose> <xsl:when test="$target = 'devel'" > <param-name>oxf.resources.priority.3</param-name> </xsl:when> <xsl:otherwise> <param-name>oxf.resources.priority.1</param-name> </xsl:otherwise> </xsl:choose> <param-value>org.orbeon.oxf.resources.WebAppResourceManagerFactory</param-value> </context-param> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'flat file resource manager'"/> <xsl:with-param name="commented" select="$target != 'devel'"/> <xsl:with-param name="content"> <context-param> <param-name>oxf.resources.filesystem.sandbox-directory</param-name> <param-value> <xsl:choose> <xsl:when test="$target = 'devel'"><xsl:value-of select="$build-root"/>/src/examples/web</xsl:when> <xsl:otherwise>C:/path/to/my/resources</xsl:otherwise> </xsl:choose> </param-value> </context-param> <context-param> <param-name>oxf.resources.priority.1</param-name> <param-value>org.orbeon.oxf.resources.FilesystemResourceManagerFactory</param-value> </context-param> </xsl:with-param> </xsl:call-template> <context-param> <param-name>oxf.resources.priority.2</param-name> <param-value>org.orbeon.oxf.resources.ClassLoaderResourceManagerFactory</param-value> </context-param> <xsl:comment> OXF Class Loader </xsl:comment> <context-param> <param-name>oxf.classloader.enable</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>oxf.classloader.ignore-packages</param-name> <param-value>java. javax. org.apache.log4j. org.xml. org.w3c.</param-value> </context-param> <xsl:comment> Set location of properties.xml (read by resource manager) </xsl:comment> <context-param> <param-name>oxf.properties</param-name> <param-value>oxf:/config/properties.xml</param-value> </context-param> <xsl:comment> Set XML Server configuration file </xsl:comment> <context-param> <param-name>oxf.xml-server.config</param-name> <param-value>oxf:/ops/xml-server/xml-server.xml</param-value> </context-param> <xsl:comment> Set context listener processors </xsl:comment> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'context listener processors'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <context-param> <param-name>oxf.context-initialized-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.context-initialized-processor.input.config</param-name> <param-value>oxf:/context/context-initialized.xpl</param-value> </context-param> <context-param> <param-name>oxf.context-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.context-destroyed-processor.input.config</param-name> <param-value>oxf:/context/context-destroyed.xpl</param-value> </context-param> </xsl:with-param> </xsl:call-template> <xsl:comment> Set session listener processors </xsl:comment> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'session listener processors'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <context-param> <param-name>oxf.session-created-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.session-created-processor.input.config</param-name> <param-value>oxf:/context/session-created.xpl</param-value> </context-param> <context-param> <param-name>oxf.session-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </context-param> <context-param> <param-name>oxf.session-destroyed-processor.input.config</param-name> <param-value>oxf:/context/session-destroyed.xpl</param-value> </context-param> </xsl:with-param> </xsl:call-template> <!-- JSF is disabled (may be re-enabled in a future release) --> <!-- <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'JSF example'"/> <xsl:with-param name="commented" select="$target = 'devel' or $target = 'war'"/> <xsl:with-param name="content"> <context-param> <param-name>saveStateInClient</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <filter> <filter-name>processor-filter</filter-name> <filter-class>org.orbeon.oxf.servlet.OPSServletFilter</filter-class> </filter> <filter-mapping> <filter-name>processor-filter</filter-name> <url-pattern>/faces/*</url-pattern> </filter-mapping> <listener> <listener-class>org.orbeon.faces.renderkit.ServletContextListener</listener-class> </listener> <listener> <listener-class>com.sun.faces.config.ConfigListener</listener-class> </listener> </xsl:with-param> </xsl:call-template> --> <xsl:comment> Set PresentationServer listeners </xsl:comment> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'listeners'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <listener> <listener-class>org.orbeon.oxf.webapp.OPSServletContextListener</listener-class> </listener> <listener> <listener-class>org.orbeon.oxf.webapp.OPSSessionListener</listener-class> </listener> </xsl:with-param> </xsl:call-template> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'XML Server'"/> <xsl:with-param name="commented" select="true()"/> <xsl:with-param name="content"> <listener> <listener-class>org.orbeon.oxf.xmlserver.ContextListener</listener-class> </listener> </xsl:with-param> </xsl:call-template> <servlet> <servlet-name>ops-main-servlet</servlet-name> <servlet-class>org.orbeon.oxf.servlet.OPSServlet</servlet-class> <xsl:comment> Set main processor </xsl:comment> <init-param> <param-name>oxf.main-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}page-flow</param-value> </init-param> <init-param> <param-name>oxf.main-processor.input.controller</param-name> <param-value>oxf:/page-flow.xml</param-value> </init-param> <xsl:comment> Set error processor </xsl:comment> <init-param> <param-name>oxf.error-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.error-processor.input.config</param-name> <param-value>oxf:/config/error.xpl</param-value> </init-param> <xsl:comment> Set initialization listener </xsl:comment> <init-param> <param-name>oxf.servlet-initialized-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.servlet-initialized-processor.input.config</param-name> <param-value>oxf:/context/servlet-initialized.xpl</param-value> </init-param> <xsl:comment> Set destruction listener </xsl:comment> <init-param> <param-name>oxf.servlet-destroyed-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.servlet-destroyed-processor.input.config</param-name> <param-value>oxf:/context/servlet-destroyed.xpl</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>ops-xforms-server-servlet</servlet-name> <servlet-class>org.orbeon.oxf.servlet.OPSServlet</servlet-class> <xsl:comment> Set main processor </xsl:comment> <init-param> <param-name>oxf.main-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.main-processor.input.config</param-name> <param-value>oxf:/ops/xforms/xforms-server.xpl</param-value> </init-param> <xsl:comment> Set error processor </xsl:comment> <init-param> <param-name>oxf.error-processor.name</param-name> <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value> </init-param> <init-param> <param-name>oxf.error-processor.input.config</param-name> <param-value>oxf:/ops/xforms/xforms-server-error.xpl</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>display-chart-servlet</servlet-name> <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet> <servlet-name>struts-servlet</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>config/examples/struts/module</param-name> <param-value>/WEB-INF/struts-module.xml</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'SQL examples'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <servlet> <servlet-name>hsqldb-servlet</servlet-name> <servlet-class>org.hsqldb.Servlet</servlet-class> <init-param> <param-name>hsqldb.server.database</param-name> <param-value>orbeondb</param-value> </init-param> <load-on-startup>4</load-on-startup> </servlet> </xsl:with-param> </xsl:call-template> <!-- JSF is disabled (may be re-enabled in a future release) --> <!-- <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'JSF example'"/> <xsl:with-param name="commented" select="$target = 'devel' or $target = 'war'"/> <xsl:with-param name="content"> <servlet> <servlet-name>jsf</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>5</load-on-startup> </servlet> </xsl:with-param> </xsl:call-template> --> <servlet-mapping> <servlet-name>ops-main-servlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ops-xforms-server-servlet</servlet-name> <url-pattern>/xforms-server</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>struts-servlet</servlet-name> <url-pattern>/struts/*</url-pattern> </servlet-mapping> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'SQL examples'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <servlet-mapping> <servlet-name>hsqldb-servlet</servlet-name> <url-pattern>/db</url-pattern> </servlet-mapping> </xsl:with-param> </xsl:call-template> <servlet-mapping> <servlet-name>display-chart-servlet</servlet-name> <url-pattern>/chartDisplay</url-pattern> </servlet-mapping> <!-- JSF is disabled (may be re-enabled in a future release) --> <!-- <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'JSF example'"/> <xsl:with-param name="commented" select="$target = 'devel' or $target = 'war'"/> <xsl:with-param name="content"> <servlet-mapping> <servlet-name>jsf</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> </xsl:with-param> </xsl:call-template> --> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'SQL examples'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <resource-ref> <description>DataSource</description> <res-ref-name>jdbc/db</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </xsl:with-param> </xsl:call-template> <xsl:call-template name="comment"> <xsl:with-param name="caption" select="'authentication example'"/> <xsl:with-param name="commented" select="$target = 'war'"/> <xsl:with-param name="content"> <security-constraint> <web-resource-collection> <web-resource-name>Administration</web-resource-name> <url-pattern>/examples-standalone/authentication</url-pattern> </web-resource-collection> <auth-constraint> <role-name>administrator</role-name> </auth-constraint> </security-constraint> <login-config> <auth-method>FORM</auth-method> <form-login-config> <form-login-page>/examples-standalone/authentication/login</form-login-page> <form-error-page>/examples-standalone/authentication/login-error</form-error-page> </form-login-config> </login-config> <security-role> <role-name>administrator</role-name> </security-role> </xsl:with-param> </xsl:call-template> </web-app> </xsl:template> <xsl:template name="comment"> <xsl:param name="caption"/> <xsl:param name="commented"/> <xsl:param name="content"/> <xsl:comment> <xsl:text> Uncomment this for the </xsl:text> <xsl:value-of select="$caption"/> <xsl:text> </xsl:text> </xsl:comment> <xsl:choose> <xsl:when test="$commented"> <xsl:comment> <xsl:for-each select="exslt:node-set($content)/*"> <xsl:call-template name="to-text"> <xsl:with-param name="node" select="."/> </xsl:call-template> </xsl:for-each> </xsl:comment> </xsl:when> <xsl:otherwise> <xsl:copy-of select="exslt:node-set($content)/*"/> </xsl:otherwise> </xsl:choose> <xsl:comment> <xsl:text> End </xsl:text> <xsl:value-of select="$caption"/> <xsl:text> </xsl:text> </xsl:comment> </xsl:template> <xsl:template name="to-text"> <xsl:param name="node"/> <xsl:param name="level" select="1"/> <xsl:choose> <xsl:when test="name($node) != ''"> <xsl:text> </xsl:text> <xsl:call-template name="indent"> <xsl:with-param name="level" select="$level"/> </xsl:call-template> <xsl:text><</xsl:text> <xsl:value-of select="name($node)"/> <xsl:text>></xsl:text> <xsl:for-each select="$node/node()"> <xsl:call-template name="to-text"> <xsl:with-param name="node" select="."/> <xsl:with-param name="level" select="$level + 1"/> </xsl:call-template> </xsl:for-each> <xsl:if test="count($node/*) > 0"> <xsl:text> </xsl:text> <xsl:call-template name="indent"> <xsl:with-param name="level" select="$level"/> </xsl:call-template> </xsl:if> <xsl:text></</xsl:text> <xsl:value-of select="name($node)"/> <xsl:text>></xsl:text> </xsl:when> <xsl:otherwise> <xsl:value-of select="$node"/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="indent"> <xsl:param name="level"/> <xsl:if test="$level > 0"> <xsl:text> </xsl:text> <xsl:call-template name="indent"> <xsl:with-param name="level" select="$level - 1"/> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Erik:
exslt: makes sense, just synced with CVS and it seems to work very well sith Saxon. Only problem is a small typo on line 4 of the web.xsl: exclude-result-prefixes="exsl xslt" should be exclude-result-prefixes="exslt xslt" (missing "t" in exsl) If you run a XSL with version="1.0" with Saxon, it will throw a Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor but executes the transform as 2.0. BTW, is there a simple way to install/run the latest CVS version under Eclipse? I'm usually using the File>Import->OIS Application from WAR which means I each time need to reinstall my custom apps, processors and page-flow.xml. thanks, *P Erik Bruchez wrote: Pascal, -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
Thanks, the typo is now fixed!
Currently, there is no perfect way to import a new OPS WAR with Studio and merge it with your current application. You can do as you say, or merge the new OPS JARs and resources in. To do this well, a merge tool is probably in order. -Erik Pascal Heus wrote: > Erik: > exslt: makes sense, just synced with CVS and it seems to work very well > sith Saxon. > Only problem is a small typo on line 4 of the web.xsl: > exclude-result-prefixes="exsl xslt" should be > exclude-result-prefixes="exsl*t* xslt" (missing "t" in exsl) > If you run a XSL with version="1.0" with Saxon, it will throw a Warning: > Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor > but executes the transform as 2.0. > BTW, is there a simple way to install/run the latest CVS version under > Eclipse? I'm usually using the File>Import->OIS Application from WAR > which means I each time need to reinstall my custom apps, processors and > page-flow.xml. > thanks, > *P > > Erik Bruchez wrote: > >> Pascal, >> >> Thanks for the feedback! >> >> However I am surprised that your test on the version works in case >> Saxon is in 1.0 mode (which it should be, with the version="1.0" >> attribute on the root element of the transformation). Did you have to >> set it to "2.0"? In which case this would still not get us to having a >> portable stylesheet between Xalan and Saxon. >> >> But there is maybe another way: use exsl:node-set(): >> >> http://www.exslt.org/exsl/functions/node-set/index.html >> >> This function is available in Saxon and Xalan as well. Can you try >> that with your Saxon build? I attach the modified version. In the >> meanwhile, I have already switched from xalan:nodeset() to >> exslt:node-set() in CVS. >> >> -Erik >> >> Pascal Heus wrote: >> >>> Erik: >>> I just synced with CVS and built the war file using Ant under >>> Eclipse. All goes well until I hit the war-copy-descriptor section >>> that makes use of a xalan specific nodeset() extension in the >>> "comment" template of the descriptors/examples/web/web.xsl tranform. >>> Since I endorse Saxon8 in my java environment, it doesn't find the >>> Xalan extension and throws the error shown below. I therefore >>> slightly ajusted the web.xsl file to detect if the XSL processor is >>> "2.0" which can then simply access the node set without the need of >>> the xalan extension function (file attached). Might be useful to >>> other non-xalan / 2.0 developers. >>> cheers, >>> *P >> >>------------------------------------------------------------------------ >> >> >>-- >>You receive this message as a subscriber of the [hidden email] mailing list. >>To unsubscribe: mailto:[hidden email] >>For general help: mailto:[hidden email]?subject=help >>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >> >> > > > ------------------------------------------------------------------------ > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Pascal Heus
I wanted to mention that I have entered a new bug related to this example:
http://forge.objectweb.org/tracker/index.php?func=detail&aid=304408&group_id=168&atid=350207 Repeat index updates are fairly tricky! -Erik Pascal Heus wrote: > Erik: > many thanks for the fix and the extended xforms:delete explanation, this > may answer a few of the other problems I've been facing in more complex > nested repeats conditions. Will pick up the latest CVS and see what > happens. I'll gladly help documenting this, let me know which format I > should use. > cheers, > Pascal > > Erik Bruchez wrote: > >> Pascal, >> >> Good catch! This bug (in fact I found 2 or 3 separate issues) is now >> fixed in CVS. >> >> Note that you make a somewhat incorrect use of the xforms:delete "at" >> attribute. You have something of the form: >> >> <xforms:repeat id="level-1-repeat" nodeset="level-1[position() < >> last()]"> >> ... >> <xforms:delete nodeset="." at="index('level-1-repeat')" >> ev:event="DOMActivate"/> >> >> Within an xforms:repeat iteration, the context node is always a single >> node corresponding to a particular node of the repeat nodeset. This is >> also true for your nested xforms:delete, which means that your >> xforms:delete nodeset evaluates also to a single node. >> >> This means that your "at" attribute should evaluate to "1" to delete >> the current row. However, with the above code, it evaluates to >> whatever the current index for the repeat is: 1 for deleting the first >> row, 2 for deleting the second, 3 for the third. But the index of the >> "at" attribute operates against the "nodeset" attribute of >> xforms:delete, which is a single node. So as per the XForm spec, >> unless your "at" attribute evaluates to 1, it is adjusted to be within >> the bounds of the node-set, that is, always 1. So you should replace >> the line with either: >> >> <xforms:delete nodeset="." at="1" ev:event="DOMActivate"/> >> >> or: >> >> <xforms:delete nodeset="../level-1[position() < last()]" >> at="index('level-1-repeat')" ev:event="DOMActivate"/> >> >> Besides this, your example looks good! We should include something >> like this in the list of OPS examples. >> >> -Erik >> >> Pascal Heus wrote: >> > Hi, >> > coud someone look at the short attached page and let me know why it >> > doesn't not work when I have the level-2 nested repeat? >> > What is the XForms error "repeatChildren and newNodeset have different >> > sizes" >> > >> > Case #1 >> > - load the page, click on the Del button for row 1 in the top table >> > --> works fine >> > - load the page, click on the Del button for row 2 in the top table >> > --> XForms error: repeatChildren and newNodeset have different >> sizes. >> > >> > Case #2 (remove level-2 repeat at end of code, see marked section) >> > - load the page, click on the Del button for row 1 of top table >> > --> works fine >> > - load the page, click on the Del button for row 2 of top table >> > --> works fine >> > >> > I have a more complex case with 3 or 4 nested repeat but need to solve >> > this one first.... >> > I'm running OPS 3 Beta 4. Any suggestion would be appreciated. >> > many thanks >> > Pascal >> >> >>------------------------------------------------------------------------ >> >> >>-- >>You receive this message as a subscriber of the [hidden email] mailing list. >>To unsubscribe: mailto:[hidden email] >>For general help: mailto:[hidden email]?subject=help >>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >> >> > > > ------------------------------------------------------------------------ > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |