The "original" Old Fan's XML document editing program-not a normal shanty! (Original Attachment Program)

Source: Internet
Author: User

Introduction:

Recently, I started a company's mobile project. Although there is already a decent XML file operation class on the network, I feel that I have never written it myself, but it is not easy to use it for myself, so I took the time to write such a smallProgram(This article uses the desktop version as an example). It mainly has the following functions:

    • Generate an XML document based on your configuration (file name, encoding method, and root node ).
    • Add, modify, and delete subnodes (multi-attribute addition and multi-node addition are supported)
    • Add, modify, and delete node content or attributes
    • Preview modification results in real time
    • Save XML document

Features:

First, it allows you to directly use the XPath language for node location, which intuitively reflects the document structure and facilitates us to add, modify, and delete the document on the next day.

Second, it supports adding multiple attributes of a node. All attributes of a node can be added at a time. (Multi-node insertion will be supported in later versions)

Of course, there are still many imperfections in it. For example, the location of modification and deletion operations is still relatively mechanical and manual input, but it is not well related to the XPath syntax, the next version will continue to fix this issue.

Usage:

1. First, after installing the program, open it and enter the main interface. Then, fill in the XML document attributes to be created in the "basic attributes" column, for example:

(The transparent function is purely entertaining. Haha, you can slide the benchmark left and right to change the transparency of the Form)

Click Save document, select the path and file name, and you will see the New XML document in the preview panel on the right:

 

2. Next, insert a subnode to the root node. First, fill in our XPath path in the "Modify node" column and tell the program our root node, facilitate the positioning of the inserted nodes below.

The name of the inserted node is "person ". As shown in: You can see that after adding, the person Node just added is added in the preview area on the right, but we just added an empty node,

Next we will enrich him.

3. Now, on the Attribute Modification tab, insert a subnode with attributes for person: the settings are as follows:

Remember to check the "multiple attributes" option, and then click "put into temporary tables" to make it available. You think the node attributes and attribute values are correct, click "put into the temporary table" First (this will be prompted), because we will continue to add attributes for this student node.

Now, add the following attributes:

After entering the information, click "add to cache table" to save it.

4. Finally, click the "add" button in "Node operations". For a moment, the preview area on the right should be as follows:

In this way, we have completed a simple addition operation. In this process, you can refer to the XPath syntax to perform some settings and discover new things.

Finally, let's look at an example of xpath:

In "Modify node", change XPath to the address and enter the node name and value as follows:

You can guess where the QQ node will be added after you click Add? Yes, since our XPath path already tells the system that it uses student as the root base point, the newly added node must be under this root node. The effect is as follows:

Note:Since this software was released, many places cannot afford the "Postgraduate Entrance Exam". You just have time to study it here. If you want to use it for commercial purposes, you have to worry about it, I am not responsible !!! Hey. Of course, I also hope you can give me some suggestions. I can also make it easy for me to write XML files.

In addition, the CE version is under development. In the future, we can use our mobile phone to directly operate XML documents and submit the modified documents to some places remotely ~~~~ Planning.

Program: Click to download

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.