From: daniele i. <dan...@gm...> - 2011-10-20 08:36:12
|
Hello, I have tried with dojo.xsl but without success, because for me it's not the right way to proceed, in fact I have tried also to modify the & in & before to send the response in betterform servlet so at client side I receive & but the the browser show & I have tried it in IE8 and mozilla so it seems strange that is the browser that has a bug on this otherwise also other website should have the same problem.... I'm really confusing. I have tried also another way: before I used a template with encoding UTF-8 and the default browser was ISO-8859-1 I changed it but the same problem. The strange thing is that output and textarea component are working while input no.(also with the previous difference of encoding UTF-8 for the xml stored and ISO-8859-1 for the browser) Do you have any idea? I have finished mines :( Thank you Daniele Ippoliti 2011/10/19 Lars Windauer <lar...@be...> > Daniele, > > html-form-controls.xsl is only utilized in the non-scripted version, hence > it is out of scope. > > To debug the xslt I would utilize xsl:message to cerify the template is > called as expected. > > Further I would enable all logging in log4j.xml and copy the abstract > XForms UI (you see in the console if you request form by a browser) of the > console into an XML file and transform this directly using Oxygen. > > Hth > > Lars > > On 19.10.2011, at 17:45, daniele ippoliti <dan...@gm...> wrote: > > Hello Joern, > > definitely I tried to follow your suggestion regarding the dojo.xsl. But > apparently if I modify the line 781 in the buildControl putting > > <xsl:when test="contains(@mediatype,'text/html') or > $lname='input'"> > <xsl:value-of select="bf:data/text()" > disable-output-escaping="yes"/> > </xsl:when> > > > instead of > > <xsl:when test="contains(@mediatype,'text/html')> > <xsl:value-of select="bf:data/text()" > disable-output-escaping="yes"/> > </xsl:when> > > nothing happens to the input field. > > I have also restarted a server because I saw that you use a sort of cache > for the xsl file transformers > > Do you have some idea? Which is the difference between dojo.xsl and > html-form-controls.xsl ? it seems that they have the same scope to transform > the xform in html and this make me confusing.... :-S > > Thank you for your help > > daniele ippoliti > > 2011/10/19 daniele ippoliti <dan...@gm...> > >> or maybe the quick fix could be transfor the outputStream received from >> the generateUI method in the class WebProcessor.? >> >> thank you >> >> Daniele Ippoliti >> >> >> 2011/10/19 Joern Turner <joe...@be...> >> >>> output behaves like this as its simply html output so the standard >>> browser behavior applies. My idea is that it might have to do with >>> 'disable-output-escaping' in dojo.xsl when the values are written to input >>> or textarea - but that's just an idea. But i would first look into the xslt. >>> >>> >>> Am Wed Oct 19 09:33:31 2011 schrieb daniele ippoliti: >>> >>>> ok Joern, >>>> I can try to fix the problem, but I need some help to do this, >>>> apparently seems that for xf:output the transformation works infact I'm able >>>> to see the & and not the ASCII code. could you tell me where in betterform I >>>> can start to see the trasnformationtion from xf:output to the real html, in >>>> this way I'm going to compare that structure on that one that you have for >>>> xf:input and xf:textarea. >>>> >>>> thank you for your help >>>> Daniele Ippoliti >>>> >>>> I can try to fix it, I want just to >>>> >>>> 2011/10/18 Dave Finton <dav...@gm... <mailto: >>>> dav...@gm...>**> >>>> >>>> >>>> I just tried unencoding the & string via the eXist function >>>> util:parse-html(), and while it did succeed in translating the >>>> "&" to a "&", I ended up getting the following error:* >>>> >>>> XPST0003 : Ampersands (&) must be escaped.* >>>> >>>> >>>> So, this means it is not possible to manually unencode the string >>>> on the server side. I have not tried client-side. >>>> >>>> >>>> On Tue, Oct 18, 2011 at 9:53 AM, Dave Finton >>>> <dav...@gm... <mailto:dav...@gm...>**> wrote: >>>> >>>> So, if I understand correctly, if you load the text with the >>>> & into a betterForm field (like xf:input or xf:textarea), >>>> then the unencode does not happen? Hang on just one second... >>>> >>>> ... 2 minutes of testing later ... >>>> >>>> Ah HA! I've reproduced the problem! I my case, when I put "&" >>>> in an xf:input form (in this example the search bar), the >>>> model is used to automatically fill the same field when the >>>> next page loads. Instead of seeing "&" as I would expect, I >>>> get the full "&" sequence in my field. I am using the >>>> latest development branch of betterForm. >>>> >>>> So, at this point, I'd need to defer to the actual developers >>>> of betterForms because I would not know how to fix this >>>> problem. :D >>>> >>>> Joern and Lars, is there by chance a quick and easy way to >>>> correct this behavior? I figure we're either looking at an >>>> unimplemented feature ;-) or maybe a missing flag that we >>>> aren't utilizing correctly (or at all). If you folks have any >>>> guidance, I would be interested in a solution as well. >>>> >>>> >>>> On Tue, Oct 18, 2011 at 9:30 AM, daniele ippoliti >>>> <dan...@gm... <mailto:dan...@gm...>> wrote: >>>> >>>> hello, >>>> thank you for your support :). let's say that a user is >>>> filling a forum that use xform he fills it and he saved a >>>> content of one field with an '&' character (this character >>>> thanks to the transformation has been stored like &). >>>> >>>> The same user want to modify the file that he has defined >>>> previously,but at this time, he will see instead of & >>>> ---> & in the UI. >>>> >>>> For me is in betterform that is missing the second way >>>> transformation. I want to say: >>>> 1) One side & ---> & (perfect I agree is totally >>>> necessary). >>>> 2) Second side & ---> & is missing. >>>> >>>> for the point 2) on my side (client of betterfom) I should >>>> write a javascript (with the DOM) that field by field goes >>>> to parse the content in order to have & shown instead of >>>> &, this is very unefficient, because the >>>> transformation should be done at the moment of the >>>> trasnformation from xf:input or xf:textarea or... (all the >>>> field that could contain & ) to HTML, because you will >>>> have one entry point, I don't know the internal structure >>>> of betterform but you should have a transformation from >>>> xf:input declared by the developer to HTML (div, span...) >>>> and if you apply here the function to remove all the ASCII >>>> codes with the characters you will invoke just one method >>>> of conversion to have the job done for all the xf:input >>>> >>>> something like this (pseudocode) >>>> >>>> xfInputTransformation(){ >>>> >>>> ... >>>> >>>> out.write("<div id....."); >>>> out.write("<input id.....>"); >>>> out.write(**convertSpecialCharacter(**contenInput)); >>>> out.write("</input .>"); >>>> >>>> ... >>>> } >>>> >>>> Am I totally wrong ? >>>> >>>> Thank you >>>> >>>> Daniele >>>> >>>> >>>> >>>> >>>> 2011/10/18 Dave Finton <dav...@gm... >>>> <mailto:dav...@gm...>**> >>>> >>>> >>>> >>>> I agree with you that is necessary the >>>> transformation on one side, when you submit in a >>>> resource your instance to avoid XML error and this >>>> has been done by betterform, but I thought that if >>>> the user want fill in the form and insert & he >>>> wants to see & in the next consultation of the >>>> file, so should be under the responsability of >>>> betterform/xform to do the oposite translation at >>>> reading time and not only at writing time or not? >>>> >>>> >>>> I think I may be confused on this bit. When you say >>>> "next consultation of the file". In what kind of >>>> context do you mean? If you're storing the input data >>>> in HTML or XML format, then the escape sequences very >>>> much need to stay intact. A stray "&" or ">" character >>>> will destroy the structure of the markup, and cause >>>> errors both for web browsers or XML parsers on the >>>> next read. >>>> >>>> I'm probably mixing up the meaning of your last reply, >>>> so a clarification would be most welcome. Thanks! >>>> >>>> >>>> >>>> >>>> >>>> -- David Finton >>>> >>>> >>>> >>>> >>>> -- David Finton >>>> >>>> >>>> >>>> >>>> ------------------------------**------------------------------** >>>> ------------------ >>>> All the data continuously generated in your IT infrastructure contains a >>>> definitive record of customers, application performance, security >>>> threats, fraudulent activity and more. Splunk takes this data and makes >>>> sense of it. Business sense. IT sense. Common sense. >>>> http://p.sf.net/sfu/splunk-**d2d-oct<http://p.sf.net/sfu/splunk-d2d-oct> >>>> >>>> >>>> ______________________________**_________________ >>>> Betterform-users mailing list >>>> Betterform-users@lists.**sourceforge.net<Bet...@li...> >>>> https://lists.sourceforge.net/**lists/listinfo/betterform-**users<https://lists.sourceforge.net/lists/listinfo/betterform-users> >>>> >>> >>> >>> >> > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure contains a > definitive record of customers, application performance, security > threats, fraudulent activity and more. Splunk takes this data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2d-oct > > _______________________________________________ > Betterform-users mailing list > Bet...@li... > https://lists.sourceforge.net/lists/listinfo/betterform-users > > |