Our own product
Government e-document generator software for companies in Taiwan
To send an official letter to a Taiwan government agency electronically, a company must produce two files in a strict XML format. Our web tool turns that into filling in a form, with no plug-in to install and no 100-page manual.
- Our own product, built from our own dealings with government agencies
- Software (our own product)
- Taiwan
- 2026
- Ongoing maintenance, available for licensing

- 40,016 active exchange agencies, searchable instantly
- Every di and sw file passes 104DTD validation, or it is not saved
- 70 automated tests, including DTD validation and checks against official golden samples
Inside the system
We built this product for users in Taiwan, so the screens are in Traditional Chinese.
What was getting in the way
- WebjAgent only sends and receives, so companies have to produce the document file and the exchange form themselves
- One mistake in 104DTD’s element order, entity binding or encoding rules gets the document rejected
- A wrong agency code means certain rejection, but the official address book uses full names while staff remember short ones
- There is no way to tell whether the format is right until the file is sent
How the system solves it
- Filling in a form produces the di and sw files directly, saved to WebjAgent’s default upload folder
- Templates follow 104DTD (2020 revision), with element order and NDATA entity binding built in
- A built-in national address book that expands short names and lists only agencies still in service
- DTD validation runs before saving, and a file that fails is never written
What is inside
104DTD-compliant output
Builds di and sw files to the 2020 revision, with element order, entity binding and UTF-8 encoding built in.
Validation before saving
Checks the format before anything is written. A file that fails is never saved, so format problems are caught before the document goes out.
Attachment size control
Applies the 2,048 KB limit to the total size of all attachments, as the rules require, not to each file. Going over is blocked at upload, with a prompt to use a download link instead.
National agency address book
More than 40,000 active agencies, searchable by short name. Agencies no longer in service never appear as options.
Document layout preview
An A4 preview laid out to the government’s document format guidelines, for proofreading before sending, printing or saving as a PDF.
Saved recipients and settings packs
Frequent recipients are saved as lists or groups and added in one click. Sender details and document number prefixes live in a settings pack, so switching companies means switching one file.
What changed
- Every file must pass 104DTD validation before it is generated, so format errors are caught on the user’s own computer
- The 40,016-entry address book works offline, so nobody has to match agency codes by hand
- The di file, sw file and attachments are generated together, with WebjAgent’s two-step upload order spelled out
How the project came together
In Taiwan, government agencies exchange official letters electronically in a fixed format, and private companies can join that exchange. We are one of those companies: we deal with government agencies ourselves. Registering as an exchange member is only the start. A company also has to produce the letter itself (the di file) and the exchange form (the sw file), both following the government’s 104DTD, an XML document type definition. WebjAgent, the client software the Ministry of Economic Affairs provides, only sends and receives files. Creating the document is up to you.
The usual answer is to buy a full document management system, which is too much for a company that sends a few letters a year. The government does offer a free tool for writing documents, but its manual runs past 100 pages, with 20 pages on installation alone, and it is built on browser plug-ins from the Internet Explorer era. Faced with that much effort for a handful of letters, most people go back to paper. So we built our e-document file generator (公文交換檔產生器) to solve one step only: producing a valid exchange file. You open a web page, fill in a form and get the files, with no plug-ins to install.
The hard part was the format, not the interface. 104DTD (the 2020 revision) is strict about element order, and one element out of place makes the file invalid. The sw file has to be attached to the di file as an unparsed entity in the DOCTYPE internal subset, and so does every attachment. Encoding is always UTF-8, yet most copies of the DTD circulating online are an old Big5 (a legacy Chinese text encoding) version that has since been withdrawn. Start from the wrong version and the whole build is wasted. We did not guess at any of these rules. We got the official DTD and 12 sets of sample files from the National Archives Administration’s validation site and compared them field by field before writing any code.
Agency codes are another common reason for rejection. The official address book lists more than 40,000 agencies and is updated daily, but it uses full official names, while the staff who send letters remember short names. The tool has the address book built in and expands short names, so typing “Fengshan Zhongxiao Elementary” finds “Kaohsiung City Fengshan District Zhongxiao Elementary School,” and only agencies still in service are listed. Before any file is written, the tool validates the format, and if validation fails, nothing is saved. An A4 preview, laid out to the government’s document format guidelines, lets you proofread before sending or save a PDF.
Licensing comes in three parts that can be combined: use by a single legal entity, source code delivery, and format updates for one year. Pricing is quoted case by case. Delivery includes the software, installation and setup, and one training session. It does not include applying for the company’s exchange membership or certificate, or fixing problems on the receiving agency’s end.
One limit we state plainly. The tool produces exchange files that meet the specification, but it cannot guarantee that the receiving agency will accept them, because every agency’s receiving software is implemented differently. In fact, the sample sw files released by the National Archives Administration do not fully conform to its own DTD, which shows that receiving systems do not validate strictly. Passing the format check is necessary but not sufficient, so before adopting the tool for real, a company should still send one actual document to confirm.
- Next.js
- TypeScript
- React
- Node.js
Other systems we have built
Want a system like this for your team?
Tell us how your process works today. We will scope a version for your team, with a requirements document, a detailed quote and a timeline.