Re: [Xsltforms-support] Xsltforms-support Digest, Vol 31, Issue 8
Brought to you by:
alain-couthures
|
From: Dan M. <dan...@gm...> - 2011-12-20 18:26:16
|
Hello Srividhya, Yes, this is easy to do without writing a single line of JavaScript! I call this "server-side" field validation. Here is an example: http://en.wikibooks.org/wiki/XForms/Server-Side_Field_Validation Ann Kelly wrote most of this article, so the thanks should got to her. Please let me know if this works for you and if the materials are clear. - Dan On Mon, Dec 19, 2011 at 11:43 PM, srividhya <n.s...@ni...> wrote: > Alain, > Is it possible to do the validation through some libraries or API's > for form data or xml data at server side without using XMLSchema or XForms > bind controls.. > > N. Srividhya > OTC, N. I. C, > Chennai > > > On 12/17/11, xsl...@li... wrote: > > Send Xsltforms-support mailing list submissions to > xsl...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > or, via email, send a message with subject or body 'help' to > xsl...@li... > > You can reach the person managing the list at > xsl...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Xsltforms-support digest..." > > > Today's Topics: > > 1. Re: getting your feet wet with the profiler (was Re: > optimization question) (Jakob Fix) > 2. xforms:repeat / tr / br (st...@sa...) > 3. XSLTForms with ASP.NET (William David Velasquez) > 4. Re: XSLTForms with ASP.NET (Dan McCreary) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 14 Dec 2011 22:24:03 +0100 > From: Jakob Fix <jak...@gm...> > Subject: Re: [Xsltforms-support] getting your feet wet with the > profiler (was Re: optimization question) > To: Kurt Cagle <kur...@gm...> > Cc: xsl...@li... > Message-ID: > <CAC...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > Hi Kurt, this is the exact same behaviour we have observed, and Alain > suggested using the profiler to find out where the bottlenecks might > be. Our forms are also served by MarkLogic, although that's a > coincidence rather than the reason, of course. > > Jakob. > > > > On Wed, Dec 14, 2011 at 22:16, Kurt Cagle <kur...@gm...> wrote: > > It may be something in the form rendering - the download of the XSLT file > > takes very little time, but I'm looking at 15-20s before the form itself > is > > rendered in Chrome - compared to 2-3 for the October release which I had > > been using. Firefox is faster, but not appreciably. This is being > delivered > > out of MarkLogic. > > > > > > Kurt Cagle > > Invited Expert, XForms Working Group, W3C > > Managing Editor, XMLToday.org > > kur...@gm... > > 443-837-8725 > > > > > > > > > > On Wed, Dec 14, 2011 at 3:11 PM, Alain Couthures > > <ala...@ag...> wrote: > >> > >> Kurt, > >> > >> I'm not sure I understand correctly. Is it that, when clicking on the > >> Profiler button, you have to wait a very long time especially on Chrome > with > >> which once you got an alert about a Javascript execution overload?? > >> > >> Thanks! > >> > >> -Alain > >> > >> Le 13/12/2011 17:30, Kurt Cagle a ?crit?: > >> > >> Alain, > >> > >> I too like the profiler, though I'm a bit distressed with the overall > >> download time for the package - on Firefox it's long but acceptable, > but on > >> Chrome it seems to take forever to load (it times out at least once). > >> > >> Kurt Cagle > >> Invited Expert, XForms Working Group, W3C > >> Managing Editor, XMLToday.org > >> kur...@gm... > >> 443-837-8725 > >> > >> > >> > >> > >> On Fri, Dec 9, 2011 at 4:09 PM, Alain Couthures > >> <ala...@ag...> wrote: > >>> > >>> Wow! What an impressive Christmas gift for XML fans! > >>> > >>> You're absolutely right about the Profiler I added to XSLTForms: it's a > >>> wonderful tool to locate time-costing XPath expressions and refreshes. > >>> > >>> In the latest builds, the Profiler is even a form: this means that it > >>> can be customized by authors themselves. The profiling data is > collected > >>> as an XML document and a specific processing-instruction tells > XSLTForms > >>> which form to associate with. > >>> > >>> I plan to add more information in the Profiler instance (instances > >>> copies, the calling form source, ...): the Profiler will progressively > >>> become a real XForms Debugger written in XForms. > >>> > >>> About your form performance, I already suspected that counting > preceding > >>> siblings would cost a lot of time: Javascript doesn't like loops > >>> (XSLTForms has to have its own XPath machine written in Javascript... I > >>> proposed a paper for XML Prague 2012 about how to write an XQuery > >>> compiler into Javascript instructions). I recently added support for > the > >>> id() function and it's even much better for performance. > >>> > >>> Defining a subform is now another possibility to simplify a form. This > >>> is not yet documented but I already love it much. Don't hesitate to ask > >>> me about subforms if you're interested in. > >>> > >>> If you want to load another form in a new browser tab from an instance > >>> without server exchanges, defining an extra parameter for the load > >>> action should be simple with the processing-instruction capability I > >>> already use for the Profiler (this processing-instruction mechanism is > >>> very promising indeed, I'm currently building a small XRAP > >>> (XForms-REST-Apache-PHP) application with minimal generic PHP scripts, > >>> XML files and folders on server). > >>> > >>> XML allows us to consider programs as data. We might not be numerous to > >>> envision this (but the community is strong) and I have to confess that > >>> I'm still marveled by this. > >>> > >>> Thank you very much for your feedbacks! > >>> > >>> -Alain > >>> > >>> Le 09/12/2011 02:41, C. M. Sperberg-McQueen a ?crit : > >>> > Just a short report, for the record, of my experience with the > profiler > >>> > now built into XSLTForms. > >>> > > >>> > Short version: ?the profiler is very helpful; in this case three > >>> > relatively > >>> > simple changes produced a five-fold speedup in the form. > >>> > > >>> > Long version: > >>> > > >>> > Looking at the profile information for the form I was worrying about, > >>> > which had gotten too slow when the document it was operating on got > >>> > bigger, I found that the most expensive XPath expressions were those > >>> > used for numbering the cells of the stack and for numbering the > >>> > instructions in the code area. ?I hard-coded appropriate numbers into > >>> > attributes in the machine description, and I added a set of actions > for > >>> > adding a numbering attribute to the instructions in a program, after > >>> > loading it. I then replaced each XPath expression of the form > >>> > count(preceding-sibling::cell) +1 or count(preceding-sibling::i) with > >>> > a reference to @n. ?I also removed the support for editing the > program > >>> > code; I'll move it to a separate form which communicates with the > >>> > main form by bouncing the XML representation of the document off > >>> > of a routine on the server. > >>> > > >>> > The first two changes (prenumbering the stack cells and autonumbering > >>> > the instructions in the program) reduced the XForms Cumulative > Refresh > >>> > Time after loading a program and stepping through 50 cycles of > machine > >>> > time (i.e. clicking Step 50 times) from 94.6 seconds to 42.3 seconds, > >>> > making the program about twice as fast. > >>> > > >>> > The third change (removing the editing functionality to a separate > >>> > form) > >>> > took it down to 17.7 seconds, another twofold speedup, for a > five-fold > >>> > speedup overall. > >>> > > >>> > Those who are curious can compare the timings and the subjective > >>> > experience of the form by looking at the old and new versions of the > >>> > form at > >>> > > >>> > http://blackmesatech.com/2011/12/pl0/v01.xhtml (old) > >>> > http://blackmesatech.com/2011/12/pl0/index.xhtml (new) > >>> > > >>> > (Hmm. ?I notice that the XSLTforms I'm using on that server is > >>> > an old version that doesn't yet have the profiler. ?I'll have to > update > >>> > soon.) > >>> > > >>> > >>> > >>> > >>> > ------------------------------------------------------------------------------ > >>> Cloud Services Checklist: Pricing and Packaging Optimization > >>> This white paper is intended to serve as a reference, checklist and > point > >>> of > >>> discussion for anyone considering optimizing the pricing and packaging > >>> model > >>> of a cloud services business. Read Now! > >>> http://www.accelacomm.com/jaw/sfnl/114/51491232/ > >>> _______________________________________________ > >>> Xsltforms-support mailing list > >>> Xsl...@li... > >>> https://lists.sourceforge.net/lists/listinfo/xsltforms-support > >> > >> > >> > > > > > > > ------------------------------------------------------------------------------ > > Cloud Computing - Latest Buzzword or a Glimpse of the Future? > > This paper surveys cloud computing today: What are the benefits? > > Why are businesses embracing it? What are its payoffs and pitfalls? > > http://www.accelacomm.com/jaw/sdnl/114/51425149/ > > _______________________________________________ > > Xsltforms-support mailing list > > Xsl...@li... > > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > > > > > ------------------------------ > > Message: 2 > Date: Thu, 15 Dec 2011 09:23:21 -0500 > From: st...@sa... > Subject: [Xsltforms-support] xforms:repeat / tr / br > To: xsl...@li... > Message-ID: <201...@we...> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > Hi, Alain, > > I have refactored my search form to use bind instead of group and things > are a bit better--with FF 8.0.1 the behaviour is as expected. > > On Safari/Chrome, a spurious <br/> is inserted (there is supposed to be > one in one of the TDs but Safari/Chrome put two). To reproduce: > > http://oracc.museum.upenn.edu/oas-nogroup.xml > > Click on the '+' button beside the hint diamond: the two rows of controls > should be separated by one <br/> but there are two there. > > On Opera, clicking on the '+' button changes the border indicating the > press has been received, but then nothing further happens. > > On IE 9 I get an XSLTForms Exception Incorrect Javascript code generation: > ReferenceError xsltforms_initImpl is undefined. > > Thanks for any insight, > > Steve > > > > > > > ------------------------------ > > Message: 3 > Date: Fri, 16 Dec 2011 16:11:14 -0500 > From: William David Velasquez <wi...@bi...> > Subject: [Xsltforms-support] XSLTForms with ASP.NET > To: <xsl...@li...> > Message-ID: <c11...@bi...> > Content-Type: text/plain; charset=UTF-8; format=flowed > > Hi XForms fans! > > I just saved tons of work using XForms instead of WebForms in a .NET > project I?m currently working. > > It's pretty easy to include an XForms in a ASP.NET page using XSLTForms > and the asp:Xml Control for a server side transform. This line does the > trick: > > <asp:Xml ID="Xml1" runat="server" DocumentSource="~/myform.xforms" > TransformSource="~/xsltforms/xsltforms.xsl" EnableViewState="False" > ></asp:Xml> > > And to process the submission with DOM, two lines do the work: > > <%@ Page Language="C#" %> > <% > System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); > doc.Load(Request.InputStream); > > // process your xml here.... > > %> > > There is just two things to keep in mind: > > 1. You need the latest version of XSLTForms from the repository (I > tested with rev 521). Previous versions don?t work with .NET > transformation engine. > > 2. ASP.NET WebForms wraps all the controls in the page with <form > >...</form> so when the Xml Control renders the xhtml for the XForm, > clicking in the xf:triggers post the form submission (an undesirable > behavior) because they are rendered as <button> with the default > type=submit. > > There are to workarounds: > 1. Move the <asp:Xml> outside the <form runat="server"> tag in the aspx > page, > 2. When that isn't possible (for example, when you use MasterPages), > make a little modification in xsltforms.xsl to add the atributte > type="button" when triggers are rendered. This is done in this template > (line 1141 in rev 521): > > <xsl:template match="xforms:trigger|xforms:submit" ... > > Below is the generation of the <button> tag (line 1162 in rev 521): > > <button> > <xsl:copy-of select="$innerbody"/> > </button> > > You can add the attribute this way: > > <button> > <xsl:attribute name="type">button</xsl:attribute> > <xsl:copy-of select="$innerbody"/> > </button> > > I know monsieur Alain kindly will include this change in a future > release ;-) > > I'm getting mixed reaactions from my co-workers (most of them are MS > fans), so I asked them to write a form using the normal aspnet way to > calculate an invoice, allowing users to add details lines, sum totals, > taxes, etc. They had to write more than 50 tricky lines of code, with > events handlers, javascript and a lot of Googling. Then I showed it with > XForms: five xf:bind and two xf:trigger for custom logic > > No need to say they are starting to get convinced. > > Merry Christmas, > > > William Velasquez > > > > ------------------------------ > > Message: 4 > Date: Fri, 16 Dec 2011 22:01:28 -0600 > From: Dan McCreary <dan...@gm...> > Subject: Re: [Xsltforms-support] XSLTForms with ASP.NET > To: William David Velasquez <wi...@bi...> > Cc: xsl...@li... > Message-ID: > <CAO...@ma...> > Content-Type: text/plain; charset="iso-8859-1" > > William, > > Thank you for sharing this story. It is always good to hear of > knowledgeable people showing the rest of the world "The Declarative Way". > I hope your team shares their results with others. > > - Dan > > On Fri, Dec 16, 2011 at 3:11 PM, William David Velasquez < > wi...@bi...> wrote: > > > Hi XForms fans! > > > > I just saved tons of work using XForms instead of WebForms in a .NET > > project I?m currently working. > > > > It's pretty easy to include an XForms in a ASP.NET page using XSLTForms > > and the asp:Xml Control for a server side transform. This line does the > > trick: > > > > <asp:Xml ID="Xml1" runat="server" DocumentSource="~/myform.xforms" > > TransformSource="~/xsltforms/xsltforms.xsl" EnableViewState="False" > > ></asp:Xml> > > > > And to process the submission with DOM, two lines do the work: > > > > <%@ Page Language="C#" %> > > <% > > System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); > > doc.Load(Request.InputStream); > > > > // process your xml here.... > > > > %> > > > > There is just two things to keep in mind: > > > > 1. You need the latest version of XSLTForms from the repository (I > > tested with rev 521). Previous versions don?t work with .NET > > transformation engine. > > > > 2. ASP.NET WebForms wraps all the controls in the page with <form > > >...</form> so when the Xml Control renders the xhtml for the XForm, > > clicking in the xf:triggers post the form submission (an undesirable > > behavior) because they are rendered as <button> with the default > > type=submit. > > > > There are to workarounds: > > 1. Move the <asp:Xml> outside the <form runat="server"> tag in the aspx > > page, > > 2. When that isn't possible (for example, when you use MasterPages), > > make a little modification in xsltforms.xsl to add the atributte > > type="button" when triggers are rendered. This is done in this template > > (line 1141 in rev 521): > > > > <xsl:template match="xforms:trigger|xforms:submit" ... > > > > Below is the generation of the <button> tag (line 1162 in rev 521): > > > > <button> > > <xsl:copy-of select="$innerbody"/> > > </button> > > > > You can add the attribute this way: > > > > <button> > > <xsl:attribute name="type">button</xsl:attribute> > > <xsl:copy-of select="$innerbody"/> > > </button> > > > > I know monsieur Alain kindly will include this change in a future > > release ;-) > > > > I'm getting mixed reaactions from my co-workers (most of them are MS > > fans), so I asked them to write a form using the normal aspnet way to > > calculate an invoice, allowing users to add details lines, sum totals, > > taxes, etc. They had to write more than 50 tricky lines of code, with > > events handlers, javascript and a lot of Googling. Then I showed it with > > XForms: five xf:bind and two xf:trigger for custom logic > > > > No need to say they are starting to get convinced. > > > > Merry Christmas, > > > > > > William Velasquez > > > > > > > ------------------------------------------------------------------------------ > > Learn Windows Azure Live! Tuesday, Dec 13, 2011 > > Microsoft is holding a special Learn Windows Azure training event for > > developers. It will provide a great way to learn Windows Azure and what > it > > provides. You can attend the event by watching it streamed LIVE online. > > Learn more at http://p.sf.net/sfu/ms-windowsazure > > _______________________________________________ > > Xsltforms-support mailing list > > Xsl...@li... > > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > > > > > -- > Dan McCreary > Semantic Solutions Architect > office: (952) 931-9198 > cell: (612) 986-1552 > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > > ------------------------------------------------------------------------------ > Learn Windows Azure Live! Tuesday, Dec 13, 2011 > Microsoft is holding a special Learn Windows Azure training event for > developers. It will provide a great way to learn Windows Azure and what it > provides. You can attend the event by watching it streamed LIVE online. > Learn more at http://p.sf.net/sfu/ms-windowsazure > > ------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > > End of Xsltforms-support Digest, Vol 31, Issue 8 > ************************************************ > > -- > With thanks and Regards, > N.Srividhya(RS-I) > O.T.C, N.I.C, > Chennai. > > ------------------------------------------------------------------------------ > Write once. Port to many. > Get the SDK and tools to simplify cross-platform app development. Create > new or port existing apps to sell to consumers worldwide. Explore the > Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join > http://p.sf.net/sfu/intel-appdev > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > -- Dan McCreary Semantic Solutions Architect office: (952) 931-9198 cell: (612) 986-1552 |