Infopath File Processing

Source: Internet
Author: User
Tags xform xsl xsl file
Shit!
Let's summarize the principles first:

1. Create a form in infopath and save it. There is a file with the suffix ". xsn.
2. The xsn file is actually a multi-file compressed file, which contains several XML files, schema and XSL files.
3. decompress the xsn file using COM. Ms. util. Cab. cabdecoder (Microsoft's j ++ class) and traverse all the files in it.
4. Use XSL to interpret the XML file as XHTML, and save the elements in the form, such as input boxes and single partitions, as field elements into the database.
5. Write the XHTML form into the JSP page of the operation.

It is hard to say, and easy to say. Java's transformer can easily generate HTML based on the XSL style definition, but now the key is that all elements of the form have constraints, and these constraints are defined in manifest. in the xsf file, you need to extract the definitions and add them to the corresponding form elements for saving. This is a bit difficult.

As I continue my research today, I found the following two problems:
1. the form designed in infopath is usedProgramAfter being converted to HTML, the input box cannot be edited. However, a non-empty input box can be edited during design.
2. Non-standard HTML tags such as the date control are used, and cannot be used after being converted to HTML, which may need to be converted.

The input box cannot be edited. I went back to the company early this morning and suddenly got a brainwave. I already implemented the XML file rendered using the XSL file and output a Dom, I will use XSL to re-convert the Dom and convert it directly into XHTML. It will be okay if I try it. As for the date control, we found that JS of this date control can be fully implemented using the open-source calendar control. I used it a few days ago and just moved it directly. Add Chinese and modify file paths, A pretty date Selection control is coming out.

Then, we encountered the control conversion problem with infopath. infopath took care of complicated forms (the forms contain multiple rows of tables ), what controls do we need to convert these duplicate tables? I really don't know. Looking at the infopath SDK, I found that to completely copy all its representations in the browser, I must be able to use the object model in infopath, that is, its unique object, this is really speechless, and the progress cannot be dragged down. Otherwise, the infopath will be split.
Tomorrow, you must enter, submit, and save the data, and then query the data. The current idea is to read the created HTML first, then enter the entered data, it is stored in the database in XML format (the document structure is the same as the XML generated in HTML). When reading the form, use this XML file + XSL to convert it to the XHTML format for output. As for the modification of form data, try again after the first step of data storage is implemented.

Today, when I wrote data extraction, I found something "disgusting". How can Ms do this!
The schema of a form designed using the infopath template is a very complex document. The elements of the form are not independent. Basically, each element is contained by a parent element, which is not the key, the key is that it adds a lot of unnecessary elements to the schema! I don't know what to do.
Another is the name of the Form Control in the converted HTML document, which is automatically generated during conversion. However, in the schema, the names of these elements are defined by users, how can this problem be solved!
Oh, my God! Help!
Today, I received a letter from David, the founder of "jinform". He used XForm for conversion, but he could not process the data and performance well.

After another day, Today is Saturday, and it is no longer on Sunday. After two and a half hours of Google, I finally ran the CHBA-web, open-source things are really a matter of love, hate, and good-end package. They actually split a few, shit again. Fuck, we will fix this XForm tomorrow, I have to work overtime again. No matter what it is, fight tomorrow, don't come out, don't sleep.

Today's progress is totally unavailable. I stayed at the company for a day and got it. I still cannot completely convert the infopath form into XForm. The biggest problem is the XHTML file, after the chiaba-web conversion, the contents of the style sheet (CSS) are no longer displayed on the client (browser). This is the "masterpiece" of CHBA-web ", it is also related to blocking the loading of some style sheets during XForm conversion. If you want to continue research at home tonight, who knows that the Eclipse plug-in the house is not enough, you cannot set jboss4 as the default server, fuck! Currently, we can only look at the relationship between XForm and XSL in depth.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.