All,
I have encountered a problem with the xforms controls that I believe to be a bug. If someone could point me in the right direction, I'ld be more than happy to take a look at this (I don't really understand the code for xforms controls rendering). Does anyone have a workaround? Or am I doing something wrong here? This problem is alse reproducible in the xforms sandbox on orbeon.com Here is the output that I get (somewhat) : ============================= <form class="xforms-form" action="/editor/xforms-server-submit" method="post" onsubmit="return false"> Loading... XForms error: Unable to retrieve XForms engine state from session cache. Expression:Next Tokens:
Here is the view: ============ <?xml version='1.0' encoding='utf-8' ?> <xhtml:html xmlns=" " xmlns:aspic="http://www.cruk.com/aspic/editor/v1 " xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xforms=" http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi=" http://orbeon.org/oxf/xml/xinclude" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform " xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xsl:version="2.0" > <xhtml:head> <xhtml:meta content="text/html; charset=UTF-8" http-equiv="Content-Type" ></xhtml:meta> <xhtml:title> Expression Editor </xhtml:title> <xforms:model> <xforms:instance id="expression" > <aspic:claim> <aspic:id>-1</aspic:id> <aspic:expression></aspic:expression> <aspic:nextTokens> <aspic:nextToken> <aspic:id>-1</aspic:id> <aspic:syntax>NEG</aspic:syntax> </aspic:nextToken> <aspic:nextToken> <aspic:id>-1</aspic:id> <aspic:syntax>IDN</aspic:syntax> </aspic:nextToken> </aspic:nextTokens> <aspic:variables> <aspic:variable> <aspic:id>-1</aspic:id> <aspic:name>MyVariable</aspic:name> </aspic:variable> <aspic:variable> <aspic:id>-1</aspic:id> <aspic:name>VariableB</aspic:name> </aspic:variable> </aspic:variables> <aspic:identifiers> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aLocalidentifier</aspic:name> </aspic:identifier> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aCat</aspic:name> </aspic:identifier> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aDog</aspic:name> </aspic:identifier> </aspic:identifiers> <aspic:selectedToken> <aspic:append></aspic:append> <aspic:token></aspic:token> <aspic:identifier></aspic:identifier> <aspic:variable></aspic:variable> <aspic:number></aspic:number> </aspic:selectedToken> </aspic:claim> </xforms:instance> <xforms:submission ref="instance('expression')" id="next-token" method="post" action="/expression/next" replace="instance" instance="expression"/> </xforms:model> </xhtml:head> <xhtml:body> <div id="expression" > <h2>Expression: </h2> <xforms:output ref="instance('expression')/aspic:expression" ></xforms:output> </div> <div id="next-token" > <h2>Next Tokens:</h2> <table> <xforms:repeat id="token-repeat" nodeset="instance('expression')/aspic:nextTokens" > <!-- NEGATION --> <xforms:group ref="aspic:nextToken/aspic:syntax[text()='NEG']" id="negation"> <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" incremental="true"> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:append">~</xforms:setvalue> </xforms:action> <xforms:label>Negation</xforms:label> <xforms:help>negation is a way to say 'not'</xforms:help> <xforms:send submission="next-token" ev:event="token-added-event"/> </xforms:submit> </td> </tr> </xforms:group> <!-- NUMBER --> <xforms:group ref="aspic:nextToken/aspic:syntax[text()='NUM']" id="number"> <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" incremental="true"> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> </xforms:action> <xforms:label>Number</xforms:label> <xforms:help>Please enter a floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> <xforms:send submission="next-token" ev:event="token-added-event"/> </xforms:submit> <xforms:input ref="instance('expression')/aspic:selectedToken/aspic:append"> <xforms:label>Number</xforms:label> <xforms:help>Please enter a floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> <xforms:send submission="next-token" ev:event="token-added-event"/> </xforms:input> </td> </tr> </xforms:group> <!-- IDENTIFIER --> <xforms:group ref="aspic:nextToken/aspic:syntax[text()='IDN']" id="identifier"> <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" > <xforms:label>Identifier : </xforms:label> <xforms:send ev:event="token-added-event" submission="next-token" ></xforms:send> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:append" value="instance('expression')/aspic:selectedToken/aspic:identifier"/> </xforms:action> </xforms:submit> <xforms:select1 ref="instance('expression')/aspic:selectedToken/aspic:identifier" selection="open" id="identifier-select" incremental="true" appearance="xxforms:autocomplete" xxforms:filter="true"> <xforms:itemset nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> <xforms:label ref="aspic:name"/> <xforms:value ref="aspic:name"/> </xforms:itemset> </xforms:select1> </td> </tr> </xforms:group> <!-- VARIABLE --> <xforms:group ref="aspic:nextToken/aspic:syntax[text()='VAR']" id="variable"> <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" > <xforms:label>Variable : </xforms:label> <xforms:send ev:event="token-added-event" submission="next-token" ></xforms:send> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:append" value="instance('expression')/aspic:selectedToken/aspic:variable"/> </xforms:action> </xforms:submit> <xforms:select1 ref="instance('expression')/aspic:selectedToken/aspic:variable" selection="open" id="variable-select" incremental="true" appearance="xxforms:autocomplete" xxforms:filter="true"> <xforms:itemset nodeset="instance('expression')/aspic:variables/aspic:variable"> <xforms:label ref="aspic:name"/> <xforms:value ref="aspic:name"/> </xforms:itemset> </xforms:select1> </td> </tr> </xforms:group> <tr></tr> <tr></tr> </xforms:repeat> </table> </div> </xhtml:body> </xhtml:html> -- 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 |
aha! Tracked this one down. There are several problems here, but I solved the problem like this:
.... <!-- NEGATION --> <xforms:repeat id="negation-repeat" nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" incremental="true"> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:expression" value="concat(instance('expression')/aspic:expression, '~')"/> </xforms:action> <xforms:label>Negation</xforms:label> <xforms:help>negation is a way to say 'not'</xforms:help> <xforms:send submission="next-token" ev:event="negation-added-event"/> </xforms:submit> </td> </tr> <tr> <td> <p></p> </td> </tr> </xforms:repeat> .... Note that having only a single row in an xforms:repeat table causes the unexpected $variable$ strings to appear in the HTML. Solution is to add an empty row, like I did here: <tr> <td> <p></p> </td> </tr> By the way, is there a way to declerativly turn off the highlighting of the current xforms:repeat element? For some repeats, you really don't want this.... Hope this is helpfull to someone! Henrik On 8/20/06, Henrik Pettersen <[hidden email]> wrote:
-- 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 |
All,
Oops, no, I didn't. This is a tricky one. Any help would be greatly appreciated. If anyone can spot the mistake/bug, it would really help me out :-) Problem: ======= 1. Load initial page /expression/test/new 2. Fill in the box on the 'identifier' line, and click on the link 3. Resulting page has buggy ouput, with $xforms-label-value$ being displayed View: ===== <?xml version='1.0' encoding='utf-8' ?> <xhtml:html xmlns=" " xmlns:aspic="http://www.cruk.com/aspic/editor/v1" xmlns:ev="http://www.w3.org/2001/xml-events " xmlns:f="http://orbeon.org/oxf/xml/formatting" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml=" http://www.w3.org/1999/xhtml" xmlns:xi="http://orbeon.org/oxf/xml/xinclude" xmlns:xs=" http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms " xsl:version="2.0" > <xhtml:head> <xhtml:meta content="text/html; charset=UTF-8" http-equiv="Content-Type" ></xhtml:meta> <xhtml:title> Expression Editor </xhtml:title> <xforms:model> <xforms:instance id="text"> <aspic:text> <aspic:number>Number</aspic:number> </aspic:text> </xforms:instance> <xforms:instance id="expression" > <aspic:claim> <aspic:id>-1</aspic:id> <aspic:expression></aspic:expression> <aspic:nextTokens> <aspic:nextToken> <aspic:id>-1</aspic:id> <aspic:syntax>NEG</aspic:syntax> </aspic:nextToken> <aspic:nextToken> <aspic:id>-1</aspic:id> <aspic:syntax>IDN</aspic:syntax> </aspic:nextToken> <aspic:nextToken> <aspic:id>-1</aspic:id> <aspic:syntax>VAR</aspic:syntax> </aspic:nextToken> </aspic:nextTokens> <aspic:variables> <aspic:variable> <aspic:id>-1</aspic:id> <aspic:name>MyVariable</aspic:name> </aspic:variable> <aspic:variable> <aspic:id>-1</aspic:id> <aspic:name>VariableB</aspic:name> </aspic:variable> </aspic:variables> <aspic:identifiers> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aLocalidentifier</aspic:name> </aspic:identifier> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aCat</aspic:name> </aspic:identifier> <aspic:identifier> <aspic:id>-1</aspic:id> <aspic:name>aDog</aspic:name> </aspic:identifier> </aspic:identifiers> <aspic:selectedToken> <aspic:token></aspic:token> <aspic:identifier></aspic:identifier> <aspic:variable></aspic:variable> <aspic:number></aspic:number> </aspic:selectedToken> </aspic:claim> </xforms:instance> <xforms:instance id="errors-instance"> <errors/> </xforms:instance> <xforms:instance id="error-template"> <error id="" indexes="" label="" alert=""/> </xforms:instance> <!-- Xforms bind --> <!--xforms:bind nodeset="instance('expression')/aspic:selectedToken"> <xforms:bind nodeset="aspic:identifier" type="xs:string" constraint="matches(., '^[a-z]([A-Za-z0-9_])*$')" required="true"/> </xforms:bind--> <xforms:submission ref="instance('expression')" id="next-token" method="post" action="/expression/test/next" replace="instance" instance="expression"/> </xforms:model> </xhtml:head> <xhtml:body> <div id="expression" > <h2>Expression: </h2> <xforms:output ref="instance('expression')/aspic:expression" ></xforms:output> </div> <div id="next-token" > <h2>Next Tokens:</h2> <table> <!-- IDENTIFIER --> <xforms:repeat id="identifier-repeat" nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='IDN']" > <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" > <xforms:label>Insert identifier ... </xforms:label> <xforms:send ev:event="identifier-added-event" submission="next-token" ></xforms:send> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:expression" value="concat(instance('expression')/aspic:expression, concat(instance('expression')/aspic:selectedToken/aspic:identifier, '('))"/> </xforms:action> </xforms:submit> <xforms:select1 ref="instance('expression')/aspic:selectedToken/aspic:identifier" selection="open" id="identifier-select" incremental="true" appearance="xxforms:autocomplete" xxforms:filter="true"> <xforms:help>Please enter a name for you identifier. Note that the name must start with a lowercase letter</xforms:help> <xforms:alert>Must be a string, starting with a lowercase letter</xforms:alert> <xforms:itemset nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> <xforms:label ref="aspic:name"/> <xforms:value ref="aspic:name"/> </xforms:itemset> </xforms:select1> </td> </tr> <tr> <td> <p></p> </td> </tr> </xforms:repeat> <!-- VARIABLE --> <xforms:group> <xforms:repeat id="variable-repeat" nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[/aspic:syntax[.='VAR']" > <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" > <xforms:label>Insert variable ... </xforms:label> <xforms:send ev:event="variable-added-event" submission="next-token" ></xforms:send> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:expression" value="concat(instance('expression')/aspic:expression, instance('expression')/aspic:selectedToken/aspic:variable)"/> </xforms:action> </xforms:submit> <xforms:select1 ref="instance('expression')/aspic:selectedToken/aspic:variable" selection="open" id="variable-select" incremental="true" appearance="xxforms:autocomplete" xxforms:filter="true"> <xforms:help>Please enter a name for you variable. Note that the name must start with an uppercase letter</xforms:help> <xforms:alert>Must be a string, starting with an uppercase letter</xforms:alert> <xforms:itemset nodeset="instance('expression')/aspic:variables/aspic:variable"> <xforms:label ref="aspic:name"/> <xforms:value ref="aspic:name"/> </xforms:itemset> </xforms:select1> </td> </tr> <tr> <td> <p></p> </td> </tr> </xforms:repeat> </xforms:group> <!-- NEGATION --> <xforms:repeat id="negation-repeat" nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > <tr> <td> <xforms:submit appearance="xxforms:link" submission="next-token" incremental="true"> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> <xforms:setvalue ref="instance('expression')/aspic:expression" value="concat(instance('expression')/aspic:expression, '~')"/> </xforms:action> <xforms:label>Negation |
Administrator
|
Henrik,
Can you please resend your files attached to the email as opposed to pasted in? Copying and pasting back is a pain and it introduces errors due to line breaks. Also, in your instructions below, what should be entered in the "identifier" box, and what link should be clicked? Thanks, -Erik Henrik Pettersen wrote: > All, > > Oops, no, I didn't. > > This is a tricky one. Any help would be greatly appreciated. If anyone > can spot the mistake/bug, it would really help me out :-) > > Problem: > ======= > 1. Load initial page /expression/test/new > 2. Fill in the box on the 'identifier' line, and click on the link > 3. Resulting page has buggy ouput, with $xforms-label-value$ being displayed > > View: > ===== > <?xml version='1.0' encoding='utf-8' ?> > <xhtml:html xmlns=" " > xmlns:aspic="http://www.cruk.com/aspic/editor/v1" > xmlns:ev="http://www.w3.org/2001/xml-events > <http://www.w3.org/2001/xml-events>" > xmlns:f="http://orbeon.org/oxf/xml/formatting" > xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml=" > http://www.w3.org/1999/xhtml" > xmlns:xi="http://orbeon.org/oxf/xml/xinclude" xmlns:xs=" > http://www.w3.org/2001/XMLSchema" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms > <http://orbeon.org/oxf/xml/xforms>" xsl:version="2.0" > > <xhtml:head> > <xhtml:meta content="text/html; charset=UTF-8" > http-equiv="Content-Type" ></xhtml:meta> > > <xhtml:title> Expression Editor </xhtml:title> > > > > <xforms:model> > > <xforms:instance id="text"> > <aspic:text> > <aspic:number>Number</aspic:number> > </aspic:text> > </xforms:instance> > > > <xforms:instance id="expression" > > <aspic:claim> > <aspic:id>-1</aspic:id> > <aspic:expression></aspic:expression> > <aspic:nextTokens> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>NEG</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>IDN</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>VAR</aspic:syntax> > </aspic:nextToken> > </aspic:nextTokens> > <aspic:variables> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>MyVariable</aspic:name> > </aspic:variable> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>VariableB</aspic:name> > </aspic:variable> > </aspic:variables> > <aspic:identifiers> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aLocalidentifier</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aCat</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aDog</aspic:name> > </aspic:identifier> > </aspic:identifiers> > <aspic:selectedToken> > <aspic:token></aspic:token> > <aspic:identifier></aspic:identifier> > <aspic:variable></aspic:variable> > <aspic:number></aspic:number> > </aspic:selectedToken> > </aspic:claim> > </xforms:instance> > > <xforms:instance id="errors-instance"> > <errors/> > </xforms:instance> > > <xforms:instance id="error-template"> > <error id="" indexes="" label="" alert=""/> > </xforms:instance> > > <!-- Xforms bind --> > <!--xforms:bind > nodeset="instance('expression')/aspic:selectedToken"> > <xforms:bind nodeset="aspic:identifier" type="xs:string" > constraint="matches(., '^[a-z]([A-Za-z0-9_])*$')" required="true"/> > > </xforms:bind--> > > > <xforms:submission ref="instance('expression')" > id="next-token" > method="post" > action="/expression/test/next" > replace="instance" > instance="expression"/> > > > </xforms:model> > </xhtml:head> > > <xhtml:body> > <div id="expression" > > <h2>Expression: </h2> > <xforms:output ref="instance('expression')/aspic:expression" > ></xforms:output> > </div> > <div id="next-token" > > <h2>Next Tokens:</h2> > <table> > > <!-- IDENTIFIER --> > <xforms:repeat id="identifier-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='IDN']" > > > <tr> > <td> > <xforms:submit appearance="xxforms:link" > submission="next-token" > > <xforms:label>Insert identifier ... > </xforms:label> > <xforms:send > ev:event="identifier-added-event" submission="next-token" ></xforms:send> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > <xforms:setvalue > ref="instance('expression')/aspic:expression" > value="concat(instance('expression')/aspic:expression, > concat(instance('expression')/aspic:selectedToken/aspic:identifier, > '('))"/> > </xforms:action> > > </xforms:submit> > > <xforms:select1 > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > selection="open" > id="identifier-select" > incremental="true" > > appearance="xxforms:autocomplete" > xxforms:filter="true"> > <xforms:help>Please enter a name for you > identifier. Note that the name must start with a lowercase > letter</xforms:help> > <xforms:alert>Must be a string, starting > with a lowercase letter</xforms:alert> > <xforms:itemset > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > <xforms:label ref="aspic:name"/> > <xforms:value ref="aspic:name"/> > </xforms:itemset> > </xforms:select1> > > </td> > </tr> > <tr> > <td> > <p></p> > </td> > </tr> > </xforms:repeat> > > > <!-- VARIABLE --> > <xforms:group> > <xforms:repeat id="variable-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[/aspic:syntax[.='VAR']" > > > <tr> > <td> > <xforms:submit appearance="xxforms:link" > submission="next-token" > > <xforms:label>Insert variable ... > </xforms:label> > <xforms:send > ev:event="variable-added-event" submission="next-token" ></xforms:send> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > <xforms:setvalue > ref="instance('expression')/aspic:expression" > value="concat(instance('expression')/aspic:expression, > instance('expression')/aspic:selectedToken/aspic:variable)"/> > </xforms:action> > > </xforms:submit> > > <xforms:select1 > ref="instance('expression')/aspic:selectedToken/aspic:variable" > selection="open" > id="variable-select" > incremental="true" > > appearance="xxforms:autocomplete" > xxforms:filter="true"> > <xforms:help>Please enter a name for > you variable. Note that the name must start with an uppercase > letter</xforms:help> > <xforms:alert>Must be a string, > starting with an uppercase letter</xforms:alert> > <xforms:itemset > nodeset="instance('expression')/aspic:variables/aspic:variable"> > <xforms:label ref="aspic:name"/> > <xforms:value ref="aspic:name"/> > </xforms:itemset> > </xforms:select1> > > </td> > </tr> > <tr> > <td> > <p></p> > </td> > </tr> > </xforms:repeat> > </xforms:group> > > <!-- NEGATION --> > <xforms:repeat id="negation-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > > > <tr> > <td> > <xforms:submit appearance="xxforms:link" > submission="next-token" incremental="true"> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > <xforms:setvalue > ref="instance('expression')/aspic:expression" > value="concat(instance('expression')/aspic:expression, '~')"/> > > </xforms:action> > > > <xforms:label>Negation</xforms:label> > <xforms:help>negation is a way to say > 'not'</xforms:help> > <xforms:send submission="next-token" > ev:event="negation-added-event"/> > </xforms:submit> > </td> > </tr> > <tr> > <td> > <p></p> > </td> > </tr> > </xforms:repeat> > > <!-- NUMBER --> > <xforms:repeat id="number-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NUM']" > > > <tr> > <td> > <xforms:submit appearance="xxforms:link" > submission="next-token" > > <xforms:label>Insert floating point > number ... </xforms:label> > <xforms:send > ev:event="variable-added-event" submission="next-token" ></xforms:send> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > <xforms:setvalue > ref="instance('expression')/aspic:expression" > value="instance('expression')/aspic:selectedToken/aspic:number"/> > > </xforms:action> > > </xforms:submit> > > <xforms:input > ref="instance('expression')/aspic:selectedToken/aspic:number"> > <xforms:help>Please enter a floating > point number between 0 and 1, e.g. '0.25'</xforms:help> > <xforms:send submission="next-token" > ev:event="token-added-event"/> > <xforms:alert>Must be a floating point > number between 0 and 1</xforms:alert> > </xforms:input> > </td> > </tr> > <tr> > <td/> > <td/> > </tr> > </xforms:repeat> > </table> > </div> > </xhtml:body> > </xhtml:html> > > > PageFlow: > ========== > > <page path-info="/expression/test/new" > view="oxf:/expression/view/editor.xsl" > id="expression.test.new"/> > > <page path-info="/expression/test/next" > default-submission="oxf:/test/instance/response.xml" > id=" expression.test.next"/> > > > Default-Submission (response.xml): > ========================== > <aspic:claim xmlns:aspic="http://www.cruk.com/aspic/editor/v1 > <http://www.cruk.com/aspic/editor/v1>"> > <aspic:id>-1</aspic:id> > <aspic:expression>anIdentifier(</aspic:expression> > <aspic:nextTokens> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>IDN</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>VAR</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>NUM</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>NEG</aspic:syntax> > </aspic:nextToken> > </aspic:nextTokens> > <aspic:variables> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>MyVariable</aspic:name> > </aspic:variable> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>VariableB</aspic:name> > </aspic:variable> > </aspic:variables> > <aspic:identifiers> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aLocalidentifier</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aCat</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aDog</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>anIdentifier</aspic:name> > </aspic:identifier> > </aspic:identifiers> > <aspic:selectedToken> > <aspic:token>IDN</aspic:token> > <aspic:identifier>anIdentifier</aspic:identifier> > <aspic:variable/> > <aspic:number/> > </aspic:selectedToken> > </aspic:claim> > > Thanks! > > Henrik > > > > > On 8/20/06, *Henrik Pettersen * <[hidden email] > <mailto:[hidden email]>> wrote: > > aha! Tracked this one down. There are several problems here, but I > solved the problem like this: > > .... > > <!-- NEGATION --> > <xforms:repeat id="negation-repeat" > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > > > > <tr> > <td> > <xforms:submit appearance="xxforms:link" > submission="next-token" incremental="true"> > <xforms:action ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > <xforms:setvalue > ref="instance('expression')/aspic:expression" > value="concat(instance('expression')/aspic:expression, '~')"/> > > > </xforms:action> > > > <xforms:label>Negation</xforms:label> > <xforms:help>negation is a way to > say 'not'</xforms:help> > <xforms:send submission="next-token" > ev:event="negation-added-event"/> > </xforms:submit> > </td> > </tr> > <tr> > <td> > <p></p> > </td> > </tr> > </xforms:repeat> > .... > > Note that having only a single row in an xforms:repeat table causes > the unexpected $variable$ strings to appear in the HTML. Solution > is to add an empty row, like I did here: > > <tr> > <td> > <p></p> > </td> > </tr> > > By the way, is there a way to declerativly turn off the highlighting > of the current xforms:repeat element? For some repeats, you really > don't want this.... > > Hope this is helpfull to someone! > > Henrik > > > On 8/20/06, *Henrik Pettersen * <[hidden email] > <mailto:[hidden email]>> wrote: > > All, > > I have encountered a problem with the xforms controls that I > believe to be a bug. If someone could point me in the right > direction, I'ld be more than happy to take a look at this (I > don't really understand the code for xforms controls rendering). > Does anyone have a workaround? Or am I doing something wrong > here? This problem is alse reproducible in the xforms sandbox on > orbeon.com <http://orbeon.com> > > Here is the output that I get (somewhat) : > ============================= > Loading... XForms error: Unable to retrieve XForms engine state > from session cache. > > > Expression: > > > Next Tokens: > > Negation <http://localhost:8080/editor/expression/new> > Number <http://localhost:8080/editor/expression/new> Please > enter a floating point number between 0 and 1, e.g. '0.25' > Identifier : <http://localhost:8080/editor/expression/new> > Variable : <http://localhost:8080/editor/expression/new> > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > > Here is the view: > ============ > <?xml version='1.0' encoding='utf-8' ?> > <xhtml:html xmlns=" " xmlns:aspic=" > http://www.cruk.com/aspic/editor/v1 > <http://www.cruk.com/aspic/editor/v1>" > xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:f=" > http://orbeon.org/oxf/xml/formatting" xmlns:xforms=" > http://www.w3.org/2002/xforms" xmlns:xhtml=" > http://www.w3.org/1999/xhtml" xmlns:xi=" > http://orbeon.org/oxf/xml/xinclude" > xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl=" > http://www.w3.org/1999/XSL/Transform > <http://www.w3.org/1999/XSL/Transform>" > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > xsl:version="2.0" > > <xhtml:head> > <xhtml:meta content="text/html; charset=UTF-8" > http-equiv="Content-Type" ></xhtml:meta> > > <xhtml:title> Expression Editor </xhtml:title> > > <xforms:model> > <xforms:instance id="expression" > > <aspic:claim> > <aspic:id>-1</aspic:id> > <aspic:expression></aspic:expression> > <aspic:nextTokens> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>NEG</aspic:syntax> > </aspic:nextToken> > <aspic:nextToken> > <aspic:id>-1</aspic:id> > <aspic:syntax>IDN</aspic:syntax> > </aspic:nextToken> > </aspic:nextTokens> > <aspic:variables> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>MyVariable</aspic:name> > </aspic:variable> > <aspic:variable> > <aspic:id>-1</aspic:id> > <aspic:name>VariableB</aspic:name> > </aspic:variable> > </aspic:variables> > <aspic:identifiers> > <aspic:identifier> > <aspic:id>-1</aspic:id> > > <aspic:name>aLocalidentifier</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aCat</aspic:name> > </aspic:identifier> > <aspic:identifier> > <aspic:id>-1</aspic:id> > <aspic:name>aDog</aspic:name> > </aspic:identifier> > </aspic:identifiers> > <aspic:selectedToken> > <aspic:append></aspic:append> > <aspic:token></aspic:token> > > <aspic:identifier></aspic:identifier> > <aspic:variable></aspic:variable> > <aspic:number></aspic:number> > </aspic:selectedToken> > </aspic:claim> > </xforms:instance> > > <xforms:submission ref="instance('expression')" > id="next-token" > method="post" > action="/expression/next" > replace="instance" > instance="expression"/> > > > </xforms:model> > </xhtml:head> > > <xhtml:body> > <div id="expression" > > <h2>Expression: </h2> > <xforms:output > ref="instance('expression')/aspic:expression" > ></xforms:output> > </div> > <div id="next-token" > > <h2>Next Tokens:</h2> > <table> > <xforms:repeat id="token-repeat" > nodeset="instance('expression')/aspic:nextTokens" > > > <!-- NEGATION --> > <xforms:group > ref="aspic:nextToken/aspic:syntax[text()='NEG']" id="negation"> > <tr> > <td> > <xforms:submit > appearance="xxforms:link" submission="next-token" > incremental="true"> > <xforms:action > ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:append">~</xforms:setvalue> > > </xforms:action> > > > <xforms:label>Negation</xforms:label> > <xforms:help>negation is a > way to say 'not'</xforms:help> > <xforms:send > submission="next-token" ev:event="token-added-event"/> > </xforms:submit> > > </td> > </tr> > </xforms:group> > > <!-- NUMBER --> > <xforms:group > ref="aspic:nextToken/aspic:syntax[text()='NUM']" id="number"> > <tr> > <td> > <xforms:submit > appearance="xxforms:link" submission="next-token" > incremental="true"> > <xforms:action > ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > </xforms:action> > > > <xforms:label>Number</xforms:label> > <xforms:help>Please enter a > floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> > <xforms:send > submission="next-token" ev:event="token-added-event"/> > </xforms:submit> > <xforms:input > ref="instance('expression')/aspic:selectedToken/aspic:append"> > > > <xforms:label>Number</xforms:label> > <xforms:help>Please enter a > floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> > <xforms:send > submission="next-token" ev:event="token-added-event"/> > </xforms:input> > </td> > </tr> > </xforms:group> > > <!-- IDENTIFIER --> > <xforms:group > ref="aspic:nextToken/aspic:syntax[text()='IDN']" id="identifier"> > <tr> > <td> > <xforms:submit > appearance="xxforms:link" submission="next-token" > > <xforms:label>Identifier : > </xforms:label> > <xforms:send > ev:event="token-added-event" submission="next-token" ></xforms:send> > <xforms:action > ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:append" > > value="instance('expression')/aspic:selectedToken/aspic:identifier"/> > </xforms:action> > > </xforms:submit> > <xforms:select1 > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > selection="open" > > id="identifier-select" > incremental="true" > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > <xforms:itemset > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > > <xforms:label > ref="aspic:name"/> > <xforms:value > ref="aspic:name"/> > </xforms:itemset> > </xforms:select1> > > </td> > </tr> > </xforms:group> > > <!-- VARIABLE --> > <xforms:group > ref="aspic:nextToken/aspic:syntax[text()='VAR']" id="variable"> > <tr> > <td> > <xforms:submit > appearance="xxforms:link" submission="next-token" > > <xforms:label>Variable : > </xforms:label> > <xforms:send > ev:event="token-added-event" submission="next-token" > ></xforms:send> > <xforms:action > ev:event="DOMActivate"> > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > > <xforms:setvalue > ref="instance('expression')/aspic:selectedToken/aspic:append" > > value="instance('expression')/aspic:selectedToken/aspic:variable"/> > </xforms:action> > > </xforms:submit> > <xforms:select1 > ref="instance('expression')/aspic:selectedToken/aspic:variable" > selection="open" > > id="variable-select" > incremental="true" > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > <xforms:itemset > nodeset="instance('expression')/aspic:variables/aspic:variable"> > <xforms:label > ref="aspic:name"/> > <xforms:value > ref="aspic:name"/> > </xforms:itemset> > </xforms:select1> > </td> > </tr> > </xforms:group> > > > > <tr></tr> > <tr></tr> > </xforms:repeat> > </table> > </div> > </xhtml:body> > </xhtml:html> > > > > > ------------------------------------------------------------------------ > > > -- > 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 -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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,
of course :-) I wasn't sure if your mailing list manager would allow attachments. Please find the source attached. This is the contents of the attached zip: 0 22-08-06 13:02 resources/config/* 0 22-08-06 13:02 resources/context/* 0 22-08-06 13:02 resources/ops/* 2286 22-08-06 12:58 resources/page-flow.xml 13784 22-08-06 12:30 resources/expression/view/editor.xsl 1815 22-08-06 12:33 resources/test/instance/response.xml 639 22-08-06 12:22 resources/test/service/get.instance.xpl Thanks, Erik! Henrik On 8/21/06, Erik Bruchez <[hidden email]> wrote: > Henrik, > > Can you please resend your files attached to the email as opposed to > pasted in? Copying and pasting back is a pain and it introduces errors > due to line breaks. > > Also, in your instructions below, what should be entered in the > "identifier" box, and what link should be clicked? > > Thanks, > > -Erik > > Henrik Pettersen wrote: > > All, > > > > Oops, no, I didn't. > > > > This is a tricky one. Any help would be greatly appreciated. If anyone > > can spot the mistake/bug, it would really help me out :-) > > > > Problem: > > ======= > > 1. Load initial page /expression/test/new > > 2. Fill in the box on the 'identifier' line, and click on the link > > 3. Resulting page has buggy ouput, with $xforms-label-value$ being displayed > > > > View: > > ===== > > <?xml version='1.0' encoding='utf-8' ?> > > <xhtml:html xmlns=" " > > xmlns:aspic="http://www.cruk.com/aspic/editor/v1" > > xmlns:ev="http://www.w3.org/2001/xml-events > > <http://www.w3.org/2001/xml-events>" > > xmlns:f="http://orbeon.org/oxf/xml/formatting" > > xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml=" > > http://www.w3.org/1999/xhtml" > > xmlns:xi="http://orbeon.org/oxf/xml/xinclude" xmlns:xs=" > > http://www.w3.org/2001/XMLSchema" > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms > > <http://orbeon.org/oxf/xml/xforms>" xsl:version="2.0" > > > <xhtml:head> > > <xhtml:meta content="text/html; charset=UTF-8" > > http-equiv="Content-Type" ></xhtml:meta> > > > > <xhtml:title> Expression Editor </xhtml:title> > > > > > > > > <xforms:model> > > > > <xforms:instance id="text"> > > <aspic:text> > > <aspic:number>Number</aspic:number> > > </aspic:text> > > </xforms:instance> > > > > > > <xforms:instance id="expression" > > > <aspic:claim> > > <aspic:id>-1</aspic:id> > > <aspic:expression></aspic:expression> > > <aspic:nextTokens> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NEG</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>IDN</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>VAR</aspic:syntax> > > </aspic:nextToken> > > </aspic:nextTokens> > > <aspic:variables> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>MyVariable</aspic:name> > > </aspic:variable> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>VariableB</aspic:name> > > </aspic:variable> > > </aspic:variables> > > <aspic:identifiers> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aLocalidentifier</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aCat</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aDog</aspic:name> > > </aspic:identifier> > > </aspic:identifiers> > > <aspic:selectedToken> > > <aspic:token></aspic:token> > > <aspic:identifier></aspic:identifier> > > <aspic:variable></aspic:variable> > > <aspic:number></aspic:number> > > </aspic:selectedToken> > > </aspic:claim> > > </xforms:instance> > > > > <xforms:instance id="errors-instance"> > > <errors/> > > </xforms:instance> > > > > <xforms:instance id="error-template"> > > <error id="" indexes="" label="" alert=""/> > > </xforms:instance> > > > > <!-- Xforms bind --> > > <!--xforms:bind > > nodeset="instance('expression')/aspic:selectedToken"> > > <xforms:bind nodeset="aspic:identifier" type="xs:string" > > constraint="matches(., '^[a-z]([A-Za-z0-9_])*$')" required="true"/> > > > > </xforms:bind--> > > > > > > <xforms:submission ref="instance('expression')" > > id="next-token" > > method="post" > > action="/expression/test/next" > > replace="instance" > > instance="expression"/> > > > > > > </xforms:model> > > </xhtml:head> > > > > <xhtml:body> > > <div id="expression" > > > <h2>Expression: </h2> > > <xforms:output ref="instance('expression')/aspic:expression" > > ></xforms:output> > > </div> > > <div id="next-token" > > > <h2>Next Tokens:</h2> > > <table> > > > > <!-- IDENTIFIER --> > > <xforms:repeat id="identifier-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='IDN']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" > > > <xforms:label>Insert identifier ... > > </xforms:label> > > <xforms:send > > ev:event="identifier-added-event" submission="next-token" ></xforms:send> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, > > concat(instance('expression')/aspic:selectedToken/aspic:identifier, > > '('))"/> > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > > selection="open" > > id="identifier-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > > <xforms:help>Please enter a name for you > > identifier. Note that the name must start with a lowercase > > letter</xforms:help> > > <xforms:alert>Must be a string, starting > > with a lowercase letter</xforms:alert> > > <xforms:itemset > > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > > <xforms:label ref="aspic:name"/> > > <xforms:value ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > > > > > <!-- VARIABLE --> > > <xforms:group> > > <xforms:repeat id="variable-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[/aspic:syntax[.='VAR']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" > > > <xforms:label>Insert variable ... > > </xforms:label> > > <xforms:send > > ev:event="variable-added-event" submission="next-token" ></xforms:send> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, > > instance('expression')/aspic:selectedToken/aspic:variable)"/> > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:variable" > > selection="open" > > id="variable-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > > <xforms:help>Please enter a name for > > you variable. Note that the name must start with an uppercase > > letter</xforms:help> > > <xforms:alert>Must be a string, > > starting with an uppercase letter</xforms:alert> > > <xforms:itemset > > nodeset="instance('expression')/aspic:variables/aspic:variable"> > > <xforms:label ref="aspic:name"/> > > <xforms:value ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > </xforms:group> > > > > <!-- NEGATION --> > > <xforms:repeat id="negation-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" incremental="true"> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, '~')"/> > > > > </xforms:action> > > > > > > <xforms:label>Negation</xforms:label> > > <xforms:help>negation is a way to say > > 'not'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="negation-added-event"/> > > </xforms:submit> > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > > > <!-- NUMBER --> > > <xforms:repeat id="number-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NUM']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" > > > <xforms:label>Insert floating point > > number ... </xforms:label> > > <xforms:send > > ev:event="variable-added-event" submission="next-token" ></xforms:send> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="instance('expression')/aspic:selectedToken/aspic:number"/> > > > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:input > > ref="instance('expression')/aspic:selectedToken/aspic:number"> > > <xforms:help>Please enter a floating > > point number between 0 and 1, e.g. '0.25'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="token-added-event"/> > > <xforms:alert>Must be a floating point > > number between 0 and 1</xforms:alert> > > </xforms:input> > > </td> > > </tr> > > <tr> > > <td/> > > <td/> > > </tr> > > </xforms:repeat> > > </table> > > </div> > > </xhtml:body> > > </xhtml:html> > > > > > > PageFlow: > > ========== > > > > <page path-info="/expression/test/new" > > view="oxf:/expression/view/editor.xsl" > > id="expression.test.new"/> > > > > <page path-info="/expression/test/next" > > default-submission="oxf:/test/instance/response.xml" > > id=" expression.test.next"/> > > > > > > Default-Submission (response.xml): > > ========================== > > <aspic:claim xmlns:aspic="http://www.cruk.com/aspic/editor/v1 > > <http://www.cruk.com/aspic/editor/v1>"> > > <aspic:id>-1</aspic:id> > > <aspic:expression>anIdentifier(</aspic:expression> > > <aspic:nextTokens> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>IDN</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>VAR</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NUM</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NEG</aspic:syntax> > > </aspic:nextToken> > > </aspic:nextTokens> > > <aspic:variables> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>MyVariable</aspic:name> > > </aspic:variable> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>VariableB</aspic:name> > > </aspic:variable> > > </aspic:variables> > > <aspic:identifiers> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aLocalidentifier</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aCat</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aDog</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>anIdentifier</aspic:name> > > </aspic:identifier> > > </aspic:identifiers> > > <aspic:selectedToken> > > <aspic:token>IDN</aspic:token> > > <aspic:identifier>anIdentifier</aspic:identifier> > > <aspic:variable/> > > <aspic:number/> > > </aspic:selectedToken> > > </aspic:claim> > > > > Thanks! > > > > Henrik > > > > > > > > > > On 8/20/06, *Henrik Pettersen * <[hidden email] > > <mailto:[hidden email]>> wrote: > > > > aha! Tracked this one down. There are several problems here, but I > > solved the problem like this: > > > > .... > > > > <!-- NEGATION --> > > <xforms:repeat id="negation-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > > > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" incremental="true"> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, '~')"/> > > > > > > </xforms:action> > > > > > > <xforms:label>Negation</xforms:label> > > <xforms:help>negation is a way to > > say 'not'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="negation-added-event"/> > > </xforms:submit> > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > .... > > > > Note that having only a single row in an xforms:repeat table causes > > the unexpected $variable$ strings to appear in the HTML. Solution > > is to add an empty row, like I did here: > > > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > > > By the way, is there a way to declerativly turn off the highlighting > > of the current xforms:repeat element? For some repeats, you really > > don't want this.... > > > > Hope this is helpfull to someone! > > > > Henrik > > > > > > On 8/20/06, *Henrik Pettersen * <[hidden email] > > <mailto:[hidden email]>> wrote: > > > > All, > > > > I have encountered a problem with the xforms controls that I > > believe to be a bug. If someone could point me in the right > > direction, I'ld be more than happy to take a look at this (I > > don't really understand the code for xforms controls rendering). > > Does anyone have a workaround? Or am I doing something wrong > > here? This problem is alse reproducible in the xforms sandbox on > > orbeon.com <http://orbeon.com> > > > > Here is the output that I get (somewhat) : > > ============================= > > Loading... XForms error: Unable to retrieve XForms engine state > > from session cache. > > > > > > Expression: > > > > > > Next Tokens: > > > > Negation <http://localhost:8080/editor/expression/new> > > Number <http://localhost:8080/editor/expression/new> Please > > enter a floating point number between 0 and 1, e.g. '0.25' > > Identifier : <http://localhost:8080/editor/expression/new> > > Variable : <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > > > > > Here is the view: > > ============ > > <?xml version='1.0' encoding='utf-8' ?> > > <xhtml:html xmlns=" " xmlns:aspic=" > > http://www.cruk.com/aspic/editor/v1 > > <http://www.cruk.com/aspic/editor/v1>" > > xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:f=" > > http://orbeon.org/oxf/xml/formatting" xmlns:xforms=" > > http://www.w3.org/2002/xforms" xmlns:xhtml=" > > http://www.w3.org/1999/xhtml" xmlns:xi=" > > http://orbeon.org/oxf/xml/xinclude" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl=" > > http://www.w3.org/1999/XSL/Transform > > <http://www.w3.org/1999/XSL/Transform>" > > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > > xsl:version="2.0" > > > <xhtml:head> > > <xhtml:meta content="text/html; charset=UTF-8" > > http-equiv="Content-Type" ></xhtml:meta> > > > > <xhtml:title> Expression Editor </xhtml:title> > > > > <xforms:model> > > <xforms:instance id="expression" > > > <aspic:claim> > > <aspic:id>-1</aspic:id> > > <aspic:expression></aspic:expression> > > <aspic:nextTokens> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NEG</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>IDN</aspic:syntax> > > </aspic:nextToken> > > </aspic:nextTokens> > > <aspic:variables> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>MyVariable</aspic:name> > > </aspic:variable> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>VariableB</aspic:name> > > </aspic:variable> > > </aspic:variables> > > <aspic:identifiers> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > > > <aspic:name>aLocalidentifier</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aCat</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aDog</aspic:name> > > </aspic:identifier> > > </aspic:identifiers> > > <aspic:selectedToken> > > <aspic:append></aspic:append> > > <aspic:token></aspic:token> > > > > <aspic:identifier></aspic:identifier> > > <aspic:variable></aspic:variable> > > <aspic:number></aspic:number> > > </aspic:selectedToken> > > </aspic:claim> > > </xforms:instance> > > > > <xforms:submission ref="instance('expression')" > > id="next-token" > > method="post" > > action="/expression/next" > > replace="instance" > > instance="expression"/> > > > > > > </xforms:model> > > </xhtml:head> > > > > <xhtml:body> > > <div id="expression" > > > <h2>Expression: </h2> > > <xforms:output > > ref="instance('expression')/aspic:expression" > > ></xforms:output> > > </div> > > <div id="next-token" > > > <h2>Next Tokens:</h2> > > <table> > > <xforms:repeat id="token-repeat" > > nodeset="instance('expression')/aspic:nextTokens" > > > > > <!-- NEGATION --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='NEG']" id="negation"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > incremental="true"> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:append">~</xforms:setvalue> > > > > </xforms:action> > > > > > > <xforms:label>Negation</xforms:label> > > <xforms:help>negation is a > > way to say 'not'</xforms:help> > > <xforms:send > > submission="next-token" ev:event="token-added-event"/> > > </xforms:submit> > > > > </td> > > </tr> > > </xforms:group> > > > > <!-- NUMBER --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='NUM']" id="number"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > incremental="true"> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > > </xforms:action> > > > > > > <xforms:label>Number</xforms:label> > > <xforms:help>Please enter a > > floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> > > <xforms:send > > submission="next-token" ev:event="token-added-event"/> > > </xforms:submit> > > <xforms:input > > ref="instance('expression')/aspic:selectedToken/aspic:append"> > > > > > > <xforms:label>Number</xforms:label> > > <xforms:help>Please enter a > > floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> > > <xforms:send > > submission="next-token" ev:event="token-added-event"/> > > </xforms:input> > > </td> > > </tr> > > </xforms:group> > > > > <!-- IDENTIFIER --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='IDN']" id="identifier"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > > <xforms:label>Identifier : > > </xforms:label> > > <xforms:send > > ev:event="token-added-event" submission="next-token" ></xforms:send> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:append" > > > > value="instance('expression')/aspic:selectedToken/aspic:identifier"/> > > </xforms:action> > > > > </xforms:submit> > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > > selection="open" > > > > id="identifier-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > > > xxforms:filter="true"> > > <xforms:itemset > > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > > > > <xforms:label > > ref="aspic:name"/> > > <xforms:value > > ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > > > </td> > > </tr> > > </xforms:group> > > > > <!-- VARIABLE --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='VAR']" id="variable"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > > <xforms:label>Variable : > > </xforms:label> > > <xforms:send > > ev:event="token-added-event" submission="next-token" > > ></xforms:send> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:append" > > > > value="instance('expression')/aspic:selectedToken/aspic:variable"/> > > </xforms:action> > > > > </xforms:submit> > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:variable" > > selection="open" > > > > id="variable-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > > > xxforms:filter="true"> > > <xforms:itemset > > nodeset="instance('expression')/aspic:variables/aspic:variable"> > > <xforms:label > > ref="aspic:name"/> > > <xforms:value > > ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > </td> > > </tr> > > </xforms:group> > > > > > > > > <tr></tr> > > <tr></tr> > > </xforms:repeat> > > </table> > > </div> > > </xhtml:body> > > </xhtml:html> > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > -- > > 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 > > > -- > Orbeon - XForms Everywhere: > http://www.orbeon.com/blog/ > > > > > -- > 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 > > > resources.zip (26K) Download Attachment |
In reply to this post by Erik Bruchez
Erik,
I forgot to answer you questions below: > Also, in your instructions below, what should be entered in the > "identifier" box, and what link should be clicked? 1. Please enter the number '123' in the 'identifier' box. 2. Do not do anything else (no clicking). 3. Please observe that the page does not get updated with an error message (The 'identifier' field has been bound to a regular expression, that requires the first character to be lowercase). Hope that helps. Thank you! Henrik On 8/21/06, Erik Bruchez <[hidden email]> wrote: > Henrik, > > Can you please resend your files attached to the email as opposed to > pasted in? Copying and pasting back is a pain and it introduces errors > due to line breaks. > > Also, in your instructions below, what should be entered in the > "identifier" box, and what link should be clicked? > > Thanks, > > -Erik > > Henrik Pettersen wrote: > > All, > > > > Oops, no, I didn't. > > > > This is a tricky one. Any help would be greatly appreciated. If anyone > > can spot the mistake/bug, it would really help me out :-) > > > > Problem: > > ======= > > 1. Load initial page /expression/test/new > > 2. Fill in the box on the 'identifier' line, and click on the link > > 3. Resulting page has buggy ouput, with $xforms-label-value$ being displayed > > > > View: > > ===== > > <?xml version='1.0' encoding='utf-8' ?> > > <xhtml:html xmlns=" " > > xmlns:aspic="http://www.cruk.com/aspic/editor/v1" > > xmlns:ev="http://www.w3.org/2001/xml-events > > <http://www.w3.org/2001/xml-events>" > > xmlns:f="http://orbeon.org/oxf/xml/formatting" > > xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml=" > > http://www.w3.org/1999/xhtml" > > xmlns:xi="http://orbeon.org/oxf/xml/xinclude" xmlns:xs=" > > http://www.w3.org/2001/XMLSchema" > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms > > <http://orbeon.org/oxf/xml/xforms>" xsl:version="2.0" > > > <xhtml:head> > > <xhtml:meta content="text/html; charset=UTF-8" > > http-equiv="Content-Type" ></xhtml:meta> > > > > <xhtml:title> Expression Editor </xhtml:title> > > > > > > > > <xforms:model> > > > > <xforms:instance id="text"> > > <aspic:text> > > <aspic:number>Number</aspic:number> > > </aspic:text> > > </xforms:instance> > > > > > > <xforms:instance id="expression" > > > <aspic:claim> > > <aspic:id>-1</aspic:id> > > <aspic:expression></aspic:expression> > > <aspic:nextTokens> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NEG</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>IDN</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>VAR</aspic:syntax> > > </aspic:nextToken> > > </aspic:nextTokens> > > <aspic:variables> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>MyVariable</aspic:name> > > </aspic:variable> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>VariableB</aspic:name> > > </aspic:variable> > > </aspic:variables> > > <aspic:identifiers> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aLocalidentifier</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aCat</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aDog</aspic:name> > > </aspic:identifier> > > </aspic:identifiers> > > <aspic:selectedToken> > > <aspic:token></aspic:token> > > <aspic:identifier></aspic:identifier> > > <aspic:variable></aspic:variable> > > <aspic:number></aspic:number> > > </aspic:selectedToken> > > </aspic:claim> > > </xforms:instance> > > > > <xforms:instance id="errors-instance"> > > <errors/> > > </xforms:instance> > > > > <xforms:instance id="error-template"> > > <error id="" indexes="" label="" alert=""/> > > </xforms:instance> > > > > <!-- Xforms bind --> > > <!--xforms:bind > > nodeset="instance('expression')/aspic:selectedToken"> > > <xforms:bind nodeset="aspic:identifier" type="xs:string" > > constraint="matches(., '^[a-z]([A-Za-z0-9_])*$')" required="true"/> > > > > </xforms:bind--> > > > > > > <xforms:submission ref="instance('expression')" > > id="next-token" > > method="post" > > action="/expression/test/next" > > replace="instance" > > instance="expression"/> > > > > > > </xforms:model> > > </xhtml:head> > > > > <xhtml:body> > > <div id="expression" > > > <h2>Expression: </h2> > > <xforms:output ref="instance('expression')/aspic:expression" > > ></xforms:output> > > </div> > > <div id="next-token" > > > <h2>Next Tokens:</h2> > > <table> > > > > <!-- IDENTIFIER --> > > <xforms:repeat id="identifier-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='IDN']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" > > > <xforms:label>Insert identifier ... > > </xforms:label> > > <xforms:send > > ev:event="identifier-added-event" submission="next-token" ></xforms:send> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, > > concat(instance('expression')/aspic:selectedToken/aspic:identifier, > > '('))"/> > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > > selection="open" > > id="identifier-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > > <xforms:help>Please enter a name for you > > identifier. Note that the name must start with a lowercase > > letter</xforms:help> > > <xforms:alert>Must be a string, starting > > with a lowercase letter</xforms:alert> > > <xforms:itemset > > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > > <xforms:label ref="aspic:name"/> > > <xforms:value ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > > > > > <!-- VARIABLE --> > > <xforms:group> > > <xforms:repeat id="variable-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken[/aspic:syntax[.='VAR']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" > > > <xforms:label>Insert variable ... > > </xforms:label> > > <xforms:send > > ev:event="variable-added-event" submission="next-token" ></xforms:send> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, > > instance('expression')/aspic:selectedToken/aspic:variable)"/> > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:variable" > > selection="open" > > id="variable-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > xxforms:filter="true"> > > <xforms:help>Please enter a name for > > you variable. Note that the name must start with an uppercase > > letter</xforms:help> > > <xforms:alert>Must be a string, > > starting with an uppercase letter</xforms:alert> > > <xforms:itemset > > nodeset="instance('expression')/aspic:variables/aspic:variable"> > > <xforms:label ref="aspic:name"/> > > <xforms:value ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > </xforms:group> > > > > <!-- NEGATION --> > > <xforms:repeat id="negation-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" incremental="true"> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, '~')"/> > > > > </xforms:action> > > > > > > <xforms:label>Negation</xforms:label> > > <xforms:help>negation is a way to say > > 'not'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="negation-added-event"/> > > </xforms:submit> > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > > > <!-- NUMBER --> > > <xforms:repeat id="number-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NUM']" > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" > > > <xforms:label>Insert floating point > > number ... </xforms:label> > > <xforms:send > > ev:event="variable-added-event" submission="next-token" ></xforms:send> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="instance('expression')/aspic:selectedToken/aspic:number"/> > > > > </xforms:action> > > > > </xforms:submit> > > > > <xforms:input > > ref="instance('expression')/aspic:selectedToken/aspic:number"> > > <xforms:help>Please enter a floating > > point number between 0 and 1, e.g. '0.25'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="token-added-event"/> > > <xforms:alert>Must be a floating point > > number between 0 and 1</xforms:alert> > > </xforms:input> > > </td> > > </tr> > > <tr> > > <td/> > > <td/> > > </tr> > > </xforms:repeat> > > </table> > > </div> > > </xhtml:body> > > </xhtml:html> > > > > > > PageFlow: > > ========== > > > > <page path-info="/expression/test/new" > > view="oxf:/expression/view/editor.xsl" > > id="expression.test.new"/> > > > > <page path-info="/expression/test/next" > > default-submission="oxf:/test/instance/response.xml" > > id=" expression.test.next"/> > > > > > > Default-Submission (response.xml): > > ========================== > > <aspic:claim xmlns:aspic="http://www.cruk.com/aspic/editor/v1 > > <http://www.cruk.com/aspic/editor/v1>"> > > <aspic:id>-1</aspic:id> > > <aspic:expression>anIdentifier(</aspic:expression> > > <aspic:nextTokens> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>IDN</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>VAR</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NUM</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NEG</aspic:syntax> > > </aspic:nextToken> > > </aspic:nextTokens> > > <aspic:variables> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>MyVariable</aspic:name> > > </aspic:variable> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>VariableB</aspic:name> > > </aspic:variable> > > </aspic:variables> > > <aspic:identifiers> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aLocalidentifier</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aCat</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aDog</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>anIdentifier</aspic:name> > > </aspic:identifier> > > </aspic:identifiers> > > <aspic:selectedToken> > > <aspic:token>IDN</aspic:token> > > <aspic:identifier>anIdentifier</aspic:identifier> > > <aspic:variable/> > > <aspic:number/> > > </aspic:selectedToken> > > </aspic:claim> > > > > Thanks! > > > > Henrik > > > > > > > > > > On 8/20/06, *Henrik Pettersen * <[hidden email] > > <mailto:[hidden email]>> wrote: > > > > aha! Tracked this one down. There are several problems here, but I > > solved the problem like this: > > > > .... > > > > <!-- NEGATION --> > > <xforms:repeat id="negation-repeat" > > nodeset="instance('expression')/aspic:nextTokens/aspic:nextToken/aspic:syntax[.='NEG']" > > > > > > > <tr> > > <td> > > <xforms:submit appearance="xxforms:link" > > submission="next-token" incremental="true"> > > <xforms:action ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:expression" > > value="concat(instance('expression')/aspic:expression, '~')"/> > > > > > > </xforms:action> > > > > > > <xforms:label>Negation</xforms:label> > > <xforms:help>negation is a way to > > say 'not'</xforms:help> > > <xforms:send submission="next-token" > > ev:event="negation-added-event"/> > > </xforms:submit> > > </td> > > </tr> > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > </xforms:repeat> > > .... > > > > Note that having only a single row in an xforms:repeat table causes > > the unexpected $variable$ strings to appear in the HTML. Solution > > is to add an empty row, like I did here: > > > > <tr> > > <td> > > <p></p> > > </td> > > </tr> > > > > By the way, is there a way to declerativly turn off the highlighting > > of the current xforms:repeat element? For some repeats, you really > > don't want this.... > > > > Hope this is helpfull to someone! > > > > Henrik > > > > > > On 8/20/06, *Henrik Pettersen * <[hidden email] > > <mailto:[hidden email]>> wrote: > > > > All, > > > > I have encountered a problem with the xforms controls that I > > believe to be a bug. If someone could point me in the right > > direction, I'ld be more than happy to take a look at this (I > > don't really understand the code for xforms controls rendering). > > Does anyone have a workaround? Or am I doing something wrong > > here? This problem is alse reproducible in the xforms sandbox on > > orbeon.com <http://orbeon.com> > > > > Here is the output that I get (somewhat) : > > ============================= > > Loading... XForms error: Unable to retrieve XForms engine state > > from session cache. > > > > > > Expression: > > > > > > Next Tokens: > > > > Negation <http://localhost:8080/editor/expression/new> > > Number <http://localhost:8080/editor/expression/new> Please > > enter a floating point number between 0 and 1, e.g. '0.25' > > Identifier : <http://localhost:8080/editor/expression/new> > > Variable : <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > $xforms-label-value$ <http://localhost:8080/editor/expression/new> > > > > > > Here is the view: > > ============ > > <?xml version='1.0' encoding='utf-8' ?> > > <xhtml:html xmlns=" " xmlns:aspic=" > > http://www.cruk.com/aspic/editor/v1 > > <http://www.cruk.com/aspic/editor/v1>" > > xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:f=" > > http://orbeon.org/oxf/xml/formatting" xmlns:xforms=" > > http://www.w3.org/2002/xforms" xmlns:xhtml=" > > http://www.w3.org/1999/xhtml" xmlns:xi=" > > http://orbeon.org/oxf/xml/xinclude" > > xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl=" > > http://www.w3.org/1999/XSL/Transform > > <http://www.w3.org/1999/XSL/Transform>" > > xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" > > xsl:version="2.0" > > > <xhtml:head> > > <xhtml:meta content="text/html; charset=UTF-8" > > http-equiv="Content-Type" ></xhtml:meta> > > > > <xhtml:title> Expression Editor </xhtml:title> > > > > <xforms:model> > > <xforms:instance id="expression" > > > <aspic:claim> > > <aspic:id>-1</aspic:id> > > <aspic:expression></aspic:expression> > > <aspic:nextTokens> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>NEG</aspic:syntax> > > </aspic:nextToken> > > <aspic:nextToken> > > <aspic:id>-1</aspic:id> > > <aspic:syntax>IDN</aspic:syntax> > > </aspic:nextToken> > > </aspic:nextTokens> > > <aspic:variables> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>MyVariable</aspic:name> > > </aspic:variable> > > <aspic:variable> > > <aspic:id>-1</aspic:id> > > <aspic:name>VariableB</aspic:name> > > </aspic:variable> > > </aspic:variables> > > <aspic:identifiers> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > > > <aspic:name>aLocalidentifier</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aCat</aspic:name> > > </aspic:identifier> > > <aspic:identifier> > > <aspic:id>-1</aspic:id> > > <aspic:name>aDog</aspic:name> > > </aspic:identifier> > > </aspic:identifiers> > > <aspic:selectedToken> > > <aspic:append></aspic:append> > > <aspic:token></aspic:token> > > > > <aspic:identifier></aspic:identifier> > > <aspic:variable></aspic:variable> > > <aspic:number></aspic:number> > > </aspic:selectedToken> > > </aspic:claim> > > </xforms:instance> > > > > <xforms:submission ref="instance('expression')" > > id="next-token" > > method="post" > > action="/expression/next" > > replace="instance" > > instance="expression"/> > > > > > > </xforms:model> > > </xhtml:head> > > > > <xhtml:body> > > <div id="expression" > > > <h2>Expression: </h2> > > <xforms:output > > ref="instance('expression')/aspic:expression" > > ></xforms:output> > > </div> > > <div id="next-token" > > > <h2>Next Tokens:</h2> > > <table> > > <xforms:repeat id="token-repeat" > > nodeset="instance('expression')/aspic:nextTokens" > > > > > <!-- NEGATION --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='NEG']" id="negation"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > incremental="true"> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NEG</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:append">~</xforms:setvalue> > > > > </xforms:action> > > > > > > <xforms:label>Negation</xforms:label> > > <xforms:help>negation is a > > way to say 'not'</xforms:help> > > <xforms:send > > submission="next-token" ev:event="token-added-event"/> > > </xforms:submit> > > > > </td> > > </tr> > > </xforms:group> > > > > <!-- NUMBER --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='NUM']" id="number"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > incremental="true"> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">NUM</xforms:setvalue> > > </xforms:action> > > > > > > <xforms:label>Number</xforms:label> > > <xforms:help>Please enter a > > floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> > > <xforms:send > > submission="next-token" ev:event="token-added-event"/> > > </xforms:submit> > > <xforms:input > > ref="instance('expression')/aspic:selectedToken/aspic:append"> > > > > > > <xforms:label>Number</xforms:label> > > <xforms:help>Please enter a > > floating point number between 0 and 1, e.g. ' 0.25'</xforms:help> > > <xforms:send > > submission="next-token" ev:event="token-added-event"/> > > </xforms:input> > > </td> > > </tr> > > </xforms:group> > > > > <!-- IDENTIFIER --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='IDN']" id="identifier"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > > <xforms:label>Identifier : > > </xforms:label> > > <xforms:send > > ev:event="token-added-event" submission="next-token" ></xforms:send> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">IDN</xforms:setvalue> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:append" > > > > value="instance('expression')/aspic:selectedToken/aspic:identifier"/> > > </xforms:action> > > > > </xforms:submit> > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:identifier" > > selection="open" > > > > id="identifier-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > > > xxforms:filter="true"> > > <xforms:itemset > > nodeset="instance('expression')/aspic:identifiers/aspic:identifier"> > > > > <xforms:label > > ref="aspic:name"/> > > <xforms:value > > ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > > > </td> > > </tr> > > </xforms:group> > > > > <!-- VARIABLE --> > > <xforms:group > > ref="aspic:nextToken/aspic:syntax[text()='VAR']" id="variable"> > > <tr> > > <td> > > <xforms:submit > > appearance="xxforms:link" submission="next-token" > > > <xforms:label>Variable : > > </xforms:label> > > <xforms:send > > ev:event="token-added-event" submission="next-token" > > ></xforms:send> > > <xforms:action > > ev:event="DOMActivate"> > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:token">VAR</xforms:setvalue> > > > > <xforms:setvalue > > ref="instance('expression')/aspic:selectedToken/aspic:append" > > > > value="instance('expression')/aspic:selectedToken/aspic:variable"/> > > </xforms:action> > > > > </xforms:submit> > > <xforms:select1 > > ref="instance('expression')/aspic:selectedToken/aspic:variable" > > selection="open" > > > > id="variable-select" > > incremental="true" > > > > appearance="xxforms:autocomplete" > > > > xxforms:filter="true"> > > <xforms:itemset > > nodeset="instance('expression')/aspic:variables/aspic:variable"> > > <xforms:label > > ref="aspic:name"/> > > <xforms:value > > ref="aspic:name"/> > > </xforms:itemset> > > </xforms:select1> > > </td> > > </tr> > > </xforms:group> > > > > > > > > <tr></tr> > > <tr></tr> > > </xforms:repeat> > > </table> > > </div> > > </xhtml:body> > > </xhtml:html> > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > -- > > 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 > > > -- > Orbeon - XForms Everywhere: > http://www.orbeon.com/blog/ > > > > > -- > 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 |