Thread: Re: [Xsltforms-support] Xsltforms-support Digest, Vol 37, Issue 3
Brought to you by:
alain-couthures
From: srividhya <n.s...@ni...> - 2012-06-13 05:21:36
|
Hi all!!! Hai i have developed the application using xsltforms in offline mode. In terms of security concern, we can't able to give the application as folder(ie. with xsltforms folder and forms). so, i need your help regarding how to package as the .exe file or .jar file. If anybody have a idea help me... Awaiting for the reply... thanks, vidhya. On 06/12/12, 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: Xsltforms-support Digest, Vol 36, Issue 6 (srividhya) > 2. fix: XsltForms_browser.getNil() returns true when @xsi:nil is > specified as 'false' (Adam McKee) > 3. A blank space renders in place of my nested group should > appear (Ihe Onwuka) > 4. browser incompatibilities. CSS labels and hints not showing . > (Ihe Onwuka) > 5. Problem with upload in IE8 without Java installed (it is not > clear to user that Java is needed) (Javier D?az) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 07 Jun 2012 10:44:05 +0530 > From: srividhya <n.s...@ni...> > Subject: Re: [Xsltforms-support] Xsltforms-support Digest, Vol 36, > Issue 6 > To: Alain Couthures <ala...@ag...> > Cc: xsl...@li... > Message-ID: <fb9...@ni...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Alain, > I have one query regarding the saving the xsltforms output in the same directory of the application residing. > > I have designed a offline application using xsltforms, which is saving the form value in any of the directory which user wants , but i want to save the output of the form in root directory of the application . Is it possible ? If yes, means how to do? > Awaiting of the reply. > > -- > Srividhya > > > On 05/30/12, Alain Couthures <ala...@ag...> wrote: > > Hi Sree, > > > > You should have a look at this example: http://www.agencexml.com/xsltforms/address.xml > > > > xf:itext support is not inherited from XForms Specification but from JavaRosa implementation. > > > > Thank you for your feedbacks! > > > > -Alain > > > > Le 28/05/2012 12:06, srividhya a ?crit : > > >Hi All!!!!! > > > > > > I want to know about the international support in xsltforms. for example i have a field called "Name" in that the user has to enter either in english or hindi. How to do that one? any sample code is there means greatly help. > > > > > >with thanks, > > >sree > > > > > > > > > > -- > With thanks and Regards, > N.Srividhya(RS-I) > O.T.C, N.I.C, > Chennai. > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 2 > Date: Thu, 7 Jun 2012 20:06:56 -0600 > From: Adam McKee <Ada...@gm...> > Subject: [Xsltforms-support] fix: XsltForms_browser.getNil() returns > true when @xsi:nil is specified as 'false' > To: Xsl...@li... > Message-ID: > <CAERL=Xz=OZi...@ma...> > Content-Type: text/plain; charset="utf-8" > > Hi Alain and everyone :) > > I've spent some time integrating my software with XSLTForms, and I feel > this has been a good use of time. I had integrated with EMC Formula > before, but XSLTForms seems to have all the XForms-y goodness that I > require, with a nice open source license. I really appreciate this project. > > I've hardly got my feet wet with xsltforms.js, but I was able to find out > why values in my form were marked as invalid even though they were valid. > > If @*xsi:nil* is given as 'false', *XsltForms_browser.getNil()* will return > true, because *XsltForms_globals.booleanValue('false')* returns true > because 'false' is a string with length > 0. > > This new version of *XsltForms_browser.getNil()* behaves the same as > before, except that it returns false if @*xsi:nil* is given as 'false': > > XsltForms_browser.getNil = function(node) { > if (node.nodeType !== XsltForms_nodeType.ELEMENT) return false; > var att; > if (node.getAttributeNS) { > att = node.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", > "nil"); > } else { > att = node.selectSingleNode("@*[local-name()='nil' and > namespace-uri()='http://www.w3.org/2001/XMLSchema-instance'(http://www.w3.org/2001/XMLSchema-instance)]"); > if (!att || (att.value === "")) return false; > att = att.value; > } > return XsltForms_globals.booleanValue(att) && (att !== "false"); > }; > > The context for this is that I use @xsi:nil to make it clear which elements > have values which do not, which is helpful to me in the context of forms > processing. It's simpler to just include all the elements which may have > values, and specifying @xsi:nil='true' means it's clear there's no value, > even though the element is present. One would not typically specify > @xsi:nil='false', but it's valid to do so, and in this context of working > with forms, I find it helpful for values which may *become* nil. > > @xsi:nil is just a static attribute in a document, but it comes alive quite > easily in XForms with this bind: > > <xf:bind nodeset='//@xsi:nil' calculate="if(..='', 'true', 'false')"/> > > > The bind obviously does not work if you want to have an element be empty > and not nil, but I'm OK with not handling that case right now. > > I had trouble getting the bind to work, until I realized the problem was > Firefox-specific and I found this page: > > http://en.wikibooks.org/wiki/XSLTForms/Known_Restrictions > > > so I specify @xsi:nil='false' on the root html element and now all is well > on Firefox :) > > Something else: it seems that xs:pattern regex can't include a > forward-slash unless I backslash-escape it (which causes validation of the > schema itself to fail), or I can put it in a character set by itself: "[/]" > (which is a good workaround) > > For example: > > <xs:simpleType name="fraction"> > <xs:restriction base="xs:string"> > <!--<xs:pattern value="[0-9]+/[0-9]+"/>--> > <xs:pattern value="[0-9]+[/][0-9]+"/> > </xs:restriction> > </xs:simpleType> > > > It's easy to work around once I found it, but I wanted to mention it. > > /Adam > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 3 > Date: Fri, 8 Jun 2012 08:00:00 +0100 > From: Ihe Onwuka <ihe...@go...> > Subject: [Xsltforms-support] A blank space renders in place of my > nested group should appear > To: xsl...@li... > Message-ID: > <CAL...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > My problem is that in the view all the fields for address render as > blank - that is there is a placeholder where they should appear but it > is blank - as below. > > Clients: > Client Name:* > > Address: > > > > > > > > > > > E-Mail: > > Phone: > > Comments: > > Here is the instance > > <Client xmlns="http://www.b2b.net/plants"> > <Name/> > <Address> > <BuildingName/> > <Street/> > <City/> > <County/> > <Postcode/> > </Address> > <EmailAddress/> > <Phone/> > <Comments/> > </Client> > > Here is my model for the instance > > <xf:model xmlns:xf="http://www.w3.org/2002/xforms" id="clientModel"> > <xf:instance src="data/client.xml"/> > <xf:bind id="clientName" nodeset="b2b:Name" > type="xsd:string" required="true()"/> > <xf:bind id="clientBuildingName" > nodeset="b2b:BuildingName" type="xsd:string"/> > <xf:bind id="clientStreet" nodeset="b2b:Street" type="xsd:string"/> > <xf:bind id="clientCity" nodeset="b2b:City" type="xsd:string"/> > <xf:bind id="clientCounty" nodeset="b2b:County" type="xsd:string"/> > <xf:bind id="clientPostcode" nodeset="b2b:Postcode" > type="xsd:string"/> > <xf:bind id="clientEmailAddress" > nodeset="b2b:EmailAddress" type="xsd:string"/> > <xf:bind id="clientPhone" nodeset="b2b:Phone" type="xsd:string"/> > <xf:bind id="clientComments" nodeset="b2b:Comments" > type="xsd:string"/> > <xf:submission id="submitClient" method="Post" > action="save-new.xq"/> > </xf:model> > > Here is the view..... it is a case within xf:switch > > Note the following > 1. I have edited out the labels and hints to reduce the clutter. > 2. The ref on the group has an absolute address - however the problem > still shows when the address is relative as in group ref=b2b:Address > > <case id="clientCase"> > <group ref="/b2b:Client" model="clientModel"> > <xf:input xmlns:xf="http://www.w3.org/2002/xforms" > bind="clientName"> > </xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > <group ref="/b2b:Client/b2b:Address" model="clientModel"> > <xf:input > xmlns:xf="http://www.w3.org/2002/xforms" bind="clientBuildingName"> > </xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > <xf:input > xmlns:xf="http://www.w3.org/2002/xforms" bind="clientStreet"> > </xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > <xf:input > xmlns:xf="http://www.w3.org/2002/xforms" bind="clientCity"></xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > <xf:input > xmlns:xf="http://www.w3.org/2002/xforms" > bind="clientCounty"></xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > <xf:input > xmlns:xf="http://www.w3.org/2002/xforms" > bind="clientPostcode"></xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > </group> > <xf:input xmlns:xf="http://www.w3.org/2002/xforms" > bind="clientEmailAddress"> > </xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > <xf:input xmlns:xf="http://www.w3.org/2002/xforms" > bind="clientPhone"> > </xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > <xf:input xmlns:xf="http://www.w3.org/2002/xforms" > bind="clientComments"> > </xf:input> > <html:br xmlns:html="http://www.w3.org/1999/xhtml"/> > </group> > <xf:submit xmlns:xf="http://www.w3.org/2002/xforms" > submission="submitClient"> > <xf:label>Save</xf:label> > </xf:submit> > </case> > > > > ------------------------------ > > Message: 4 > Date: Mon, 11 Jun 2012 11:34:30 +0100 > From: Ihe Onwuka <ihe...@go...> > Subject: [Xsltforms-support] browser incompatibilities. CSS labels and > hints not showing . > To: xsl...@li... > Message-ID: > <CAL...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > I have been switching chrome and firefox. > > Chrome > My labels and hints show up on chrome but the my fieldset and legend > tags do not work. Takes forever for browser to render the the XForm > (minutes). > > Firefox > Fieldset and legend tags work but labels and hints don't display ..... > slow to render but not nearly as slow as chrome and > > I am running on ubuntu 12.4 > > > > ------------------------------ > > Message: 5 > Date: Tue, 12 Jun 2012 20:18:20 +0200 > From: Javier D?az <jd...@tc...> > Subject: [Xsltforms-support] Problem with upload in IE8 without Java > installed (it is not clear to user that Java is needed) > To: XSLTForms support <xsl...@li...> > Message-ID: <4FD...@tc...> > Content-Type: text/plain; charset="iso-8859-1" > > Hello, > > In order to test my web with IE, I installed a virtual machine to test it. > > When testing upload control, it didn't work, it didn't load the applet, > but no error message appeared. > > Another person tested it and I realized I hadn't java installed in my > virtual machine. > > The only problem with IE8 and Java is that it doesn't appear a clear > error that says to you that you need Java to use the web. Instead, it > appear a javascript error in IE that people don't pay attention to it. > > I have done this change in my xsltforms version in order to make clear > that Java is not installed: > > > if (document.applets.xsltforms) { > return document.applets.xsltforms.readFile(fname, > encoding, xsdtype, title) || ""; > } else { > - if( document.getElementById("xsltforms_applet") ) { > + if( document.getElementById("xsltforms_applet") && > (typeof document.getElementById("xsltforms_applet").readFile != > 'undefined')) { > return > document.getElementById("xsltforms_applet").readFile(fname, encoding, > xsdtype, title) || ""; > } else { > XsltForms_browser.loadapplet(); > if (document.applets.xsltforms) { > return > document.applets.xsltforms.readFile(fname, encoding, xsdtype, title) || ""; > } else { > - if( > document.getElementById("xsltforms_applet") ) { > + if( > document.getElementById("xsltforms_applet") && (typeof > document.getElementById("xsltforms_applet").readFile != 'undefined')) { > return > document.getElementById("xsltforms_applet").readFile(fname, encoding, > xsdtype, title) || ""; > + } else { > + alert("Error: Java no est? > habilitado. Es necesario Java para subir ficheros en Internet Explorer"); > } > } > } > > (Alert message is intentionally in Spanish, because is an internal web) > > I hope it is useful to anybody. > > Best Regards, > Javier > > PS: > > > > > > > > > > > > > > > > ************************************************************************************************************************************************ > *La informaci?n contenida en este mensaje de correo electr?nico es confidencial y puede revestir el car?cter de reservada. * > *Est? dirigida exclusivamente a la persona destinataria. * > *El acceso o cualquier uso por parte de cualquier otra persona de este mensaje no est?n autorizados y pueden ser ilegales.* > *Si no es Ud. la persona destinataria, le rogamos que proceda a borrarlo. * > *The information in this e-mail is confidential and may be legally privileged. * > *It is intended solely for the addressee. * > *Access or any use by any other person to this Internet e-mail is not authorised and may be unlawful. * > *If you are not the intended recipient, please delete this e-mail. * > ************************************************************************************************************************************************ > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: jdiaz.vcf > Type: text/x-vcard > Size: 397 bytes > Desc: not available > > ------------------------------ > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > ------------------------------ > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support > > > End of Xsltforms-support Digest, Vol 37, Issue 3 > ************************************************ > > -- With thanks and Regards, N.Srividhya(RS-I) O.T.C, N.I.C, Chennai. |
From: Alain C. <ala...@ag...> - 2012-06-14 20:27:10
|
Hi vidhya, I think that XSLTForms could do the trick with just an extension to the current applet. I can image a form allowing to select a folder and different options. The applet will then return an XML document serialization having hexa encoded files in this folder as leaf elements. Then, an XSLT 1.0 stylesheet can transform this document into a source file. This source file would include a basic HTTP server and would start a browser at the initial page (There are online examples for tiny HTTP servers in C for gcc or in Java). The last step would, of course, be to compile the generated source file (with a generated command file maybe?). What do you think? -Alain Le 13/06/2012 07:19, srividhya a écrit : > Hi all!!! > Hai i have developed the application using xsltforms in offline > mode. In terms of security concern, we can't able to give the > application as folder(ie. with xsltforms folder and forms). so, i need > your help regarding how to package as the .exe file or .jar file. If > anybody have a idea help me... > Awaiting for the reply... > > thanks, > vidhya. |
From: William V. <wi...@bi...> - 2012-06-15 16:02:45
|
I've developed a solution based in NanoHTTPD called NanoXFServer. You can download it form http://dianaydavid.com/download/nanoxfserver.zip Basically is a tiny Java Webserver that supports PUT Method, so you can save XForms submissions locally. Take a look to instance-save-test.xforms Sadly, my wordpress based website, has been shut down, with the full documentation. But here is a transcript: NANOXFSERVER * WHAT IS IT? NanoXFServer is a really small web server based in Java that can handle PUT and XML-URLENCODED-POSTXForms submission methods. It´s based in the smallest, fully functional WebServer available in Java: NanoHTTPD http://elonen.iki.fi/code/nanohttpd/ [1] * WHY A WEB SERVER FOR XFORMS? If you are developing XForms using a javascript based implementation (probably XSLTForms), you must be facing two problems if you want to run your XForms locally: * For security reasons, javascript is disabled (fully or partially, depending on your browser) when you open a local file in your browser, so your XForms won't work. * There is no way of saving the XML Instance data to a local file (for security reasons also), so you need javscript tricks or a full web server if you want to see the XForm data The purpose of NanoXFServer is to allow XForms to run locally for testing (or maybe for full local applications) without an Web Server (like Apache or eXist-db) * HOW IT WORKS? The simplest way of using NanoXFServer is to copy nanoxfserver.jar to the folder where your XForms resides, and then run it with the following command: JAVA -JAR NANOXFSERVER.JAR Then point your browser to http://localhost and you´ll get a listing of the files on your directory. Choose your XForms and it's running. Take in account that you'll need two prerequisites: * You'll need Java JRE installed on yout computer * If you are using a client based XForms Implementation (like XSLTForms) you´ll need the appropiated files (xsltforms folder) and processing instructions in your XForms, in order to get it running For saving your instances locally, use the PUT submission method, and specify a relative file name in the ACTION or RESOURCE attribute of the submission element, like this: <XF:SUBMISSION ID="DOPUT" RESOURCE="DATA/PUTDATA.XML" METHOD="PUT" /> XML Instance will be stored in a file named PUTDATA.XML under the DATA folder (the folder must exists).. If you are using XSLTForms, you can also use the XML-URLENCODED-POST method, this way: <XF:SUBMISSION ID="DOPOST" RESOURCE="POSTDATA.XML" METHOD="XML-URLENCODED-POST"> Using XML-URLENCODED-POST, the browser will show the resulting instance (useful for quick testing) * WHAT CAN IT DO? NanoXFServer adds the following features to NanoHTTPD: * Support for PUT submission method. * Support for XML-URLENCODED-POST submission method (supported in XSLTForms). * XML Instances are saved with UTF-8 file encoding * Inhibits use of .. on instance saving. * Serves the following file extensions as etxt/xml: .xml .xsl .xslt .xsd .xforms * Serves .xhtml files as application/xhtml+xml (not supported for all browsers) Here is a complete list of features form the NanoHTTPD web page: * Only one Java file * Java 1.1 compatible * Released as open source, Modified BSD licence * No fixed config files, logging, authorization etc. (Implement by yourself if you need them.) * Supports parameter parsing of GET and POST methods * Parameter names must be unique. (Adding support to multiple instance of a parameter is not difficult, but would make the interface a bit more cumbersome to use.) * Supports both dynamic content and file serving * Supports file upload (since version 1.2, 2010) * Never caches anything * Doesn't limit bandwidth, request time or simultaneous connections * Default code serves files and shows all HTTP parameters and headers * File server supports directory listing, index.html and index.htm * File server supports partial content (streaming) * File server supports ETags * File server does the 301 redirection trick for directories without / * File server supports simple skipping for files (continue download) * File server serves also very long files without memory overhead * Contains a built-in list of most common mime types * All header names are converted lowercase so they don't vary between browsers/clients Hope this help you or at least bring new ideas, Bill El 2012-06-14 15:27, Alain Couthures escribió: > Hi vidhya, > > I think that XSLTForms could do the trick with just an extension to the > current applet. > > I can image a form allowing to select a folder and different options. > The applet will then return an XML document serialization having hexa > encoded files in this folder as leaf elements. > > Then, an XSLT 1.0 stylesheet can transform this document into a source file. > > This source file would include a basic HTTP server and would start a > browser at the initial page (There are online examples for tiny HTTP > servers in C for gcc or in Java). > > The last step would, of course, be to compile the generated source file > (with a generated command file maybe?). > > What do you think? > > -Alain > > Le 13/06/2012 07:19, srividhya a écrit : >> Hi all!!! >> Hai i have developed the application using xsltforms in offline >> mode. In terms of security concern, we can't able to give the >> application as folder(ie. with xsltforms folder and forms). so, i need >> your help regarding how to package as the .exe file or .jar file. If >> anybody have a idea help me... >> Awaiting for the reply... >> >> thanks, >> vidhya. > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support -- William David Velasquez Laboratorio de Software Bitlab http://bitlab.com.co Movil 310 412 0218 Links: ------ [1] http://elonen.iki.fi/code/nanohttpd/ |