Menu

How to write file with xsltxforms?

Help
2018-10-30
2018-11-13
  • Timofeev Dmitrii

    Hello!
    I try to write file in local computer in Firefox, but I get errors "writeFile is not a function". I think that cause is Java. Java machine does not supported in latest versions of browsers as I heard. In server I get error "405 Method Not Allowed" - no idea.
    That is my example:

    <xf:model id="user-content-dataA"> <xf:instance xmlns=""> <data> <text> </text></data> </xf:instance> <xf:submission id="user-content-save" method="put" action="dataA.xml" replace="none" encoding="utf-8"> </xf:submission></xf:model> <xf:model id="user-content-dataB"> <xf:instance xmlns=""> <ch> <it id="user-content-q1"> <let> <el> text 1 </el> </let> </it> <it id="user-content-q2"> <let> text 2 </let> </it> <it id="user-content-q3"> <let> text 3 </let> </it> </ch> </xf:instance> </xf:model> <xf:model id="user-content-number"> <xf:instance xmlns=""> <d> <num> </num></d> </xf:instance> </xf:model> <xf:select1 model="dataA" ref="text"> <xf:label> Your choice </xf:label> <xf:itemset model="dataB" nodeset="/ch/it"> <xf:label ref="@id"> <xf:copy ref="let"> </xf:copy></xf:label></xf:itemset> </xf:select1> <xf:submit submission="save" id="user-content-aa"> <xf:label>Save data</xf:label> </xf:submit>

    Can I modify my file "dataA.xml" in any way?

     
    • Alain Couthures

      Alain Couthures - 2018-11-11

      Hello Dmitrii,

      Using a local HTTP server is now the unique solution I see to effectively save a file locally from any browser.

      It is very easy to write a basic HTTP server with just Nodejs. It is a possible workaround for you?

      I am also working on an XQuery engine, named "Fleur", which can operate as an HTTP server with Nodejs. For example, I use it locally everyday to serve XSLTForms files and test files. It is not yet supporting PUT, POST or DELETE methods but it should be very easy to add them...

      What do you think?

      --Alain

       
      • Timofeev Dmitrii

        OK, thank you for explanation.
        I should use HTTP server

         
        🎉
        1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.