1.7.29 • Published 5 months ago

xmlplus v1.7.29

Weekly downloads
4
License
MIT
Repository
github
Last release
5 months ago

xmlplus ·

Xmlplus is a JavaScript framework,It can not only run on the browser-side, but also on the server-side. For more information, see https://xmlplus.cn.

Installation

If having installed the NPM client, you can install xmlplus with NPM.

$ npm install xmlplus

The following is the basic organizational structure of the project:

xmlplus/
├── xmlplus.js 
├── patch/
├── docs/
└── example/
    ├── getting-started/
    ├── docs/
    ├── components/
    └── api/

Here, the xmlplus.js is the source file. Two patch files under the patch/ are for IE9+. The docs/ and the example/ under the xmlplus/ contain subfolders with the same name. The docs/ contains document files and the example/ contains the corresponding sample code.

Basic templates

Xmlplus is a framework that can not only run on browser-side but also on server-side. Here we'll give two sets of basic templates for different environments.

Server-side based

The following is the JavaScript template we fist give to run directly on the server-side. You can modify or extend the functionality based on this. The template is very simple. After installing the xmlplus software package, you just need to create a file containing following content.

// 02-01
xmlplus("xp", function (xp, $_, t) {
    $_().imports({
        Index: {
            fun: function (sys, items, opts) {
                console.log("hello, world");
            }
        }
    });
}).startup("//xp/Index");

Having created a file containing the above content, you can execute node index to run the above template example.

In addition, please note that a comment line at the beginning of the sample. The line indicate that the current sample code is located at /example/docs/02-templete/01/. The 02 here is the chapter order and the 01 is the name of the folder containing the sample.

Browser-side based

On the browser-side, you need to prepare three files. The first is the xmlplus.js. The second you need to create is a file named index.js containing following content.

// 02-02
xmlplus("xp", function (xp, $_, t) {
    $_().imports({
        Index: {
            css: "#text { color: red; }",
            xml: "<h1 id='text'>hello, world</h1>",
            fun: function (sys, items, opts) {
                sys.text.css("font-size", "28px");
            }
        }
    });
});

At last, you need a HTML file containing following content. Here, we name the file as index.html.

<!-- 02-02 -->
<!DOCTYPE html>
<html>
    <head>
        <script src="xmlplus.js"></script>
        <script src="index.js"></script>
    </head>
    <body>
        <i:Index xmlns:i="//xp"></i:Index>
    </body>
</html>

Ensure that the above three files are in the same folder. If opening the index.html with a browser, you should be able to see the red hello, world.

1.7.21

7 months ago

1.7.22

7 months ago

1.7.23

7 months ago

1.7.24

6 months ago

1.7.25

6 months ago

1.7.26

6 months ago

1.7.27

6 months ago

1.7.28

5 months ago

1.7.29

5 months ago

1.7.18

1 year ago

1.7.20

1 year ago

1.7.14

2 years ago

1.7.10

2 years ago

1.7.11

2 years ago

1.7.12

2 years ago

1.7.13

2 years ago

1.7.9

2 years ago

1.7.6

2 years ago

1.7.5

2 years ago

1.7.4

2 years ago

1.7.3

2 years ago

1.7.2

2 years ago

1.7.0

2 years ago

1.6.19

3 years ago

1.6.17

3 years ago

1.6.16

3 years ago

1.6.18

3 years ago

1.6.15

3 years ago

1.6.14

3 years ago

1.6.13

4 years ago

1.6.12

4 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.24

6 years ago

1.5.23

6 years ago

1.5.22

6 years ago

1.5.21

6 years ago

1.5.20

6 years ago

1.5.19

6 years ago

1.5.18

7 years ago

1.5.17

7 years ago

1.5.16

7 years ago

1.5.15

7 years ago

1.5.14

7 years ago

1.5.13

7 years ago

1.5.12

7 years ago

1.5.11

7 years ago

1.5.10

7 years ago

1.5.9

7 years ago

1.5.8

7 years ago

1.5.7

7 years ago

1.5.6

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.3

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago