Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and device for extracting cascading style sheets

A cascading style sheet and extraction method technology, applied in the computer field, can solve problems such as time-consuming and low extraction efficiency, and achieve the effects of improving extraction efficiency, realizing automation, and avoiding long extraction time.

Active Publication Date: 2020-09-15
ADVANCED NEW TECH CO LTD
View PDF1 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] In view of this, the embodiment of the present application provides a method and device for extracting a cascading style sheet, which is used to solve the problem of low extraction efficiency caused by long time-consuming CSS extraction methods in the prior art

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for extracting cascading style sheets
  • Method and device for extracting cascading style sheets
  • Method and device for extracting cascading style sheets

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0040] figure 1 It is a schematic flowchart of a method for extracting CSS provided in this application, and the method may be as follows.

[0041] Step 101: Convert the code data corresponding to the HTML file to be processed into JSON data.

[0042] Wherein, the JSON data includes at least one JSON node, and the JSON node corresponds to the subcode data used to realize the set logic function in the code data.

[0043]In step 101, for each website, the webpage contained in the website can correspond to one or more HTML files respectively, the HTML file mentioned here refers to the HTML file generated after the webpage code is compiled, and the HTML file contains the content of the webpage The corresponding code data and the code data corresponding to the web page display style, then the HTML file to be processed described in the embodiment of the present application may refer to the HTML file mentioned here.

[0044] Firstly, the HTML file to be processed is obtained, and t...

Embodiment 2

[0093] image 3 It is a schematic flowchart of a method for generating an HTML file provided by the embodiment of the present application. The method can be as follows.

[0094] Step 301: Convert the code data corresponding to the first HTML file to be processed into JSON data.

[0095] Wherein, the JSON data includes at least one JSON node, and the JSON node corresponds to the subcode data used to realize the set logic function in the code data.

[0096] In step 301, the method for converting the code data corresponding to the first HTML file to be processed into JSON data is the same as the method used in step 101 in Embodiment 1.

[0097] Step 302: traverse the JSON nodes included in the JSON data, extract subcode data corresponding to style logic functions included in the JSON nodes, and store the extracted subcode data in a Cascading Style Sheet CSS file.

[0098] In step 302, the method for traversing the JSON nodes contained in the JSON data is the same ...

Embodiment 3

[0105] Figure 4 It is a schematic structural diagram of a CSS extraction device provided in this application. The CSS extraction device includes: a conversion unit 401, a traversal unit 402, an extraction unit 403, and a storage unit 404, wherein:

[0106] A conversion unit 401, configured to convert the code data corresponding to the HTML file to be processed into JSON data, wherein the JSON data includes at least one JSON node, and the JSON node corresponds to the code data used to implement the setting logic in the code data function's subcode data;

[0107] A traversal unit 402, configured to traverse the JSON nodes contained in the JSON data;

[0108] An extracting unit 403, configured to extract the subcode data corresponding to the style logic function included in the JSON node;

[0109] The storage unit 404 is configured to store the extracted subcode data in a CSS file.

[0110] In another embodiment of the present application, the conversion unit 401...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present application discloses a method and a device for extracting a cascading style sheet (CSS). The method comprises: converting code data corresponding to a to-be-processed HTML file into JSON data, wherein the JSON data comprises at least one JSON node, the JSON node is corresponding to subcode data for implementing setting of a logical function in the code data; traversing the JSON node contained in the JSON data; extracting the subcode data corresponding to the style logical function contained in the JSON node; and storing the extracted subcode data in a CSS file. According to the method and device disclosed by the present application, after obtaining the to-be-processed HTML file, the code data corresponding to the HTML file is converted into the JSON data, and the CSS in the JSON node is extracted by traversing the JSON node contained in the JSON data, so that automation of the CSS extraction can be effectively realized, the problem of the relatively long time taken in extraction due to the influence of the human factors can be effectively avoided, and the CSS extraction efficiency can be enhanced.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a method and device for extracting cascaded style sheets. Background technique [0002] With the development of Internet technology, a variety of websites have emerged on the Internet platform, and these websites can provide users with the information they need. As a basic element constituting a website, a web page is usually stored as a Hyper Text Markup Language (HTML) file. The HTML file contains the content of the web page and the display style of the web page. [0003] Usually, a website contains multiple webpages, and different webpages contain different webpage content, but the webpage presentation styles used by different webpages are roughly the same, which means that for a website, the webpage presentation styles used by different webpages The corresponding code data is roughly the same. [0004] At the beginning of webpage design, webpage code editors ed...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/38G06F8/75G06F16/958G06F40/151
CPCG06F8/38G06F8/75G06F16/958G06F40/151
Inventor 饶俊学
Owner ADVANCED NEW TECH CO LTD