CN113157276A - Layout file conversion method, device, electronic equipment and computer readable medium - Google Patents

Layout file conversion method, device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113157276A
CN113157276A CN202110627633.5A CN202110627633A CN113157276A CN 113157276 A CN113157276 A CN 113157276A CN 202110627633 A CN202110627633 A CN 202110627633A CN 113157276 A CN113157276 A CN 113157276A
Authority
CN
China
Prior art keywords
name
preset
conversion
layout file
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110627633.5A
Other languages
Chinese (zh)
Inventor
侯伟浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Publication of CN113157276A publication Critical patent/CN113157276A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

The embodiment of the disclosure discloses a layout file conversion method, a layout file conversion device, an electronic device and a computer readable medium. One embodiment of the method comprises: for each first layout file in the first set of layout files in the first target file directory, performing the following conversion steps: performing conversion processing on the first layout file based on each sub-tag name, the name space name, each attribute name and attribute value of each sub-tag and each target identifier in the first layout file to obtain a first layout file after conversion processing, wherein the first layout file is used as a second layout file; the second layout file is added to the second target file directory. The implementation method can automatically convert the first layout file into the second layout file, and does not need to rewrite the layout file when the page view development is carried out under the second type system. Therefore, the development efficiency of the page view is improved, and development resources are saved.

Description

Layout file conversion method, device, electronic equipment and computer readable medium
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a layout file conversion method, a layout file conversion device, electronic equipment and a computer readable medium.
Background
The layout file is a file for defining a page view so as to render the page view when the page is loaded. At present, after a page view is developed under one type of system, when the page view is developed under another type of system, the general adopted method is as follows: the layout file is written again under another type of system.
However, when the above-described manner is adopted, there are often technical problems as follows: the layout file under another type of system needs to be rewritten according to the layout file written earlier, which causes lower development efficiency of the page view and waste of development resources.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose a layout file conversion method, apparatus, electronic device, and computer readable medium to solve one of the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a layout file conversion method, including: for each first layout file in the first set of layout files in the first target file directory, performing the following conversion steps: converting the first layout file based on each sub-tag name, name space name, each attribute name and attribute value of each sub-tag and each target identifier in the first layout file to obtain a converted first layout file as a second layout file, wherein the first layout file is used for rendering a page view under a first type system, and the second layout file is used for rendering a page view under a second type system; and adding the second layout file to a second target file directory.
Optionally, before the above performing the following converting step, the method further comprises: and sending preset prompt information to associated display equipment, wherein the preset prompt information is used for prompting a user to add the first layout file set to the first target file directory.
Optionally, before the above performing the following converting step, the method further comprises: receiving second layout file directory configuration information; and determining the file directory as a second target file directory in response to the existence of the file directory corresponding to the second layout file directory configuration information.
Optionally, before the above performing the following converting step, the method further comprises: and in response to the absence of the file directory corresponding to the second layout file directory configuration information, creating the file directory as a second target file directory.
Optionally, before the converting the first layout file, the converting step further includes: and matching the first layout file to obtain each sub-label name, each name space name, each attribute name and attribute value of each sub-label and each target identifier.
Optionally, the converting the first layout file includes: for each of the above-mentioned respective sub-tag names, based on a preset sub-tag name conversion information set in which the preset sub-tag name conversion information in the above-mentioned preset sub-tag name conversion information set includes a pre-conversion sub-tag name and a post-conversion sub-tag name, performing the steps of: determining preset sub-tag name conversion information as target preset sub-tag name conversion information in response to the presence of preset sub-tag name conversion information included in the preset sub-tag name conversion information set, the pre-conversion sub-tag name corresponding to the sub-tag name; and replacing the sub-tag name with the converted sub-tag name included in the target preset sub-tag name conversion information.
Optionally, the converting the first layout file includes: for each name space name in the name space names, converting an information set based on a preset name space name, wherein the preset name space name conversion information in the preset name space name conversion information set comprises a name space name before conversion and a name space name after conversion, and executing the following steps: responding to the preset name space name conversion information set, wherein the preset name space name conversion information comprises name space names before conversion and corresponding to the name space names, and determining the preset name space name conversion information as target preset name space name conversion information; and replacing the name space name with the name space name after conversion included in the target preset name space name conversion information.
Optionally, the converting the first layout file includes: for each attribute name in the attribute names and the attribute values, based on a preset attribute name conversion information set, wherein the preset attribute name conversion information in the preset attribute name conversion information set comprises attribute names before conversion and attribute names after conversion, executing the following steps: responding to the preset attribute name conversion information set, wherein the preset attribute name conversion information corresponding to the attribute name and the attribute name before conversion exists, and determining the preset attribute name conversion information as target preset attribute name conversion information; replacing the attribute name with a converted attribute name included in the target preset attribute name conversion information; for each attribute value in the attribute names and the attribute values, converting an information set based on a preset attribute value, wherein the preset attribute value conversion information in the preset attribute value conversion information set comprises a pre-conversion attribute value and a post-conversion attribute value, and executing the following steps: responding to the preset attribute value conversion information set, wherein the preset attribute value conversion information corresponding to the attribute value and the attribute value before conversion exists, and determining the preset attribute value conversion information as target preset attribute value conversion information; and replacing the attribute value with the converted attribute value included in the target preset attribute value conversion information.
Optionally, the converting the first layout file includes: for each target identifier in the target identifiers, based on a preset identifier conversion information set, wherein the preset identifier conversion information in the preset identifier conversion information set includes a pre-conversion identifier and a post-conversion identifier, executing the following steps: responding to the preset identification conversion information set, wherein the preset identification conversion information corresponding to the target identification and the pre-conversion identification exist, and determining the preset identification conversion information as target preset identification conversion information; and replacing the target identification with the converted identification included in the target preset identification conversion information.
In a second aspect, some embodiments of the present disclosure provide a layout file conversion apparatus, including: an execution unit configured to, for each first layout file in the first set of layout files in the first target file directory, perform the following conversion steps: a conversion unit, configured to perform conversion processing on the first layout file based on each sub-tag name, each namespace name, each attribute name and attribute value of each sub-tag, and each target identifier in the first layout file, and obtain a first layout file after the conversion processing as a second layout file, where the first layout file is used for rendering a page view under a first type system, and the second layout file is used for rendering a page view under a second type system; an adding unit configured to add the second layout file to a second target file directory.
Optionally, before the executing unit, the apparatus further comprises: and the sending unit is configured to send preset prompting information to the associated display equipment, wherein the preset prompting information is used for prompting a user to add the first layout file set to the first target file directory.
Optionally, before the executing unit, the apparatus further comprises: a receiving unit and a determining unit. Wherein the receiving unit is configured to receive second layout file directory configuration information; the determining unit is configured to determine the file directory as a second target file directory in response to the file directory corresponding to the second layout file directory configuration information.
Optionally, before the executing unit, the apparatus further comprises: and the creating unit is configured to create the file directory as a second target file directory in response to the absence of the file directory corresponding to the second layout file directory configuration information.
Optionally, before the converting unit, the converting step further comprises: and matching the first layout file to obtain each sub-label name, each name space name, each attribute name and attribute value of each sub-label and each target identifier.
Optionally, the conversion unit comprises: a first conversion sub-unit configured to perform, for each of the respective sub-tag names, based on a preset sub-tag name conversion information set in which the preset sub-tag name conversion information in the preset sub-tag name conversion information set includes a pre-conversion sub-tag name and a post-conversion sub-tag name, the steps of: determining preset sub-tag name conversion information as target preset sub-tag name conversion information in response to the presence of preset sub-tag name conversion information included in the preset sub-tag name conversion information set, the pre-conversion sub-tag name corresponding to the sub-tag name; and replacing the sub-tag name with the converted sub-tag name included in the target preset sub-tag name conversion information.
Optionally, the conversion unit comprises: a second conversion subunit, configured to, for each name space name in the name space names, convert an information set based on a preset name space name, where preset name space name conversion information in the preset name space name conversion information set includes a name space name before conversion and a name space name after conversion, and execute the following steps: responding to the preset name space name conversion information set, wherein the preset name space name conversion information comprises name space names before conversion and corresponding to the name space names, and determining the preset name space name conversion information as target preset name space name conversion information; and replacing the name space name with the name space name after conversion included in the target preset name space name conversion information.
Optionally, the conversion unit comprises: a third conversion subunit and a fourth conversion subunit. Wherein the third converting subunit is configured to, for each attribute name in the attribute names and attribute values, convert an information set based on a preset attribute name, where preset attribute name conversion information in the preset attribute name conversion information set includes a pre-conversion attribute name and a post-conversion attribute name, and execute the following steps: responding to the preset attribute name conversion information set, wherein the preset attribute name conversion information corresponding to the attribute name and the attribute name before conversion exists, and determining the preset attribute name conversion information as target preset attribute name conversion information; and replacing the attribute name with the converted attribute name included in the target preset attribute name conversion information. The fourth conversion subunit is configured to, for each attribute value in the attribute names and attribute values, perform the following steps based on a preset attribute value conversion information set, where the preset attribute value conversion information in the preset attribute value conversion information set includes a pre-conversion attribute value and a post-conversion attribute value: responding to the preset attribute value conversion information set, wherein the preset attribute value conversion information corresponding to the attribute value and the attribute value before conversion exists, and determining the preset attribute value conversion information as target preset attribute value conversion information; and replacing the attribute value with the converted attribute value included in the target preset attribute value conversion information.
Optionally, the conversion unit comprises: a fifth conversion subunit, configured to, for each of the target identifiers, based on a preset identifier conversion information set, where the preset identifier conversion information in the preset identifier conversion information set includes a pre-conversion identifier and a post-conversion identifier, perform the following steps: responding to the preset identification conversion information set, wherein the preset identification conversion information corresponding to the target identification and the pre-conversion identification exist, and determining the preset identification conversion information as target preset identification conversion information; and replacing the target identification with the converted identification included in the target preset identification conversion information.
In a third aspect, some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium on which a computer program is stored, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect.
The above embodiments of the present disclosure have the following advantages: by the layout file conversion method of some embodiments of the disclosure, the page view development efficiency is improved, and development resources are saved. Specifically, the reasons for the low development efficiency and the waste of development resources of the page view are as follows: the layout file under another type of system needs to be rewritten according to the layout file written earlier, which causes lower development efficiency of the page view and waste of development resources. Based on this, the layout file conversion method of some embodiments of the present disclosure performs, for each first layout file in the first set of layout files in the first target file directory, the following conversion steps: first, based on each sub-tag name, each namespace name, each attribute name and attribute value of each sub-tag, and each object identifier in the first layout file, the first layout file is converted to obtain a converted first layout file as a second layout file. The first layout file is used for rendering the page view under the first type system, and the second layout file is used for rendering the page view under the second type system. Therefore, the name of each sub-label, the name space name, the name of each attribute of the sub-label, the attribute value and the target identifier in the first layout file can be automatically converted, so that the second layout file which is suitable for the second type system can be automatically generated. Then, the second layout file is added to the second target file directory. Therefore, the second layout file obtained after automatic conversion can be added to the corresponding file directory for the second type system to render the page view. And because the first layout file can be automatically converted into the second layout file, the layout file does not need to be rewritten when the page view development is carried out under the second type system. Therefore, the development efficiency of the page view is improved, and development resources are saved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
1-2 are schematic diagrams of one application scenario of a layout file conversion method according to some embodiments of the present disclosure;
FIG. 3 is a flow diagram of some embodiments of a layout file conversion method according to the present disclosure;
FIG. 4 is a flow diagram of further embodiments of a layout file conversion method according to the present disclosure;
FIG. 5 is a schematic structural diagram of some embodiments of a layout file conversion apparatus according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1-2 are schematic diagrams of one application scenario of a layout file conversion method according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, for each first layout file (e.g., first layout file 1021) in first set of layout files 102 in the first target file directory, computing device 101 may perform the following conversion steps: first, the first layout file 1021 is converted based on the respective sub tag names 10211, the respective namespace names 10212, the respective attribute names and attribute values 10213 of the respective sub tags, and the respective object identifiers 10214 in the first layout file 1021, and the converted first layout file is obtained as the second layout file 103. The first layout file 1021 is used for rendering a page view under a first type system. The second layout file 103 is used for rendering the page view in the second type system. Then, the above-described second layout file 103 is added to the second target file directory.
Alternatively, as shown in fig. 2, first, the computing device 101 may receive the second layout file directory configuration information 104. Then, the computing device 101 may determine the file directory 105 as a second target file directory in response to the file directory 105 corresponding to the second layout file directory configuration information 104.
The computing device 101 may be hardware or software. When the computing device is hardware, it may be implemented as a distributed cluster composed of multiple servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be installed in the hardware devices enumerated above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
It should be understood that the number of computing devices in fig. 1-2 is merely illustrative. There may be any number of computing devices, as implementation needs dictate.
With continued reference to FIG. 3, a flow 300 of some embodiments of a layout file conversion method according to the present disclosure is shown. The layout file conversion method comprises the following steps:
step 301, for each first layout file in the first set of layout files in the first target file directory, performing the following conversion steps:
step 3011, based on the names of the sub-tags, the names of the name spaces, the attribute names and attribute values of the sub-tags, and the target identifiers in the first layout file, performing conversion processing on the first layout file to obtain a first layout file after conversion processing as a second layout file.
In some embodiments, an execution subject (for example, the computing device 101 shown in fig. 1) of the layout file conversion method may perform conversion processing on the first layout file based on the respective sub-tag names, the respective namespace names, the respective attribute names and attribute values of the respective sub-tags, and the respective object identifiers in the first layout file, and obtain the first layout file after the conversion processing as the second layout file. The first target file directory may be a file directory for storing the first layout file set. The first layout file may be a layout file under a first type system. The first layout file is used for rendering the page view under the first type system. The first type of system described above may be a system adapted to a previously written layout file. For example, the first type system may be an "Android system". The first layout file may be an XML file under an Android system. The second layout file is used for rendering the page view under the second type system. The second type of system described above may be a system adapted for the converted layout file. For example, when the first type system is an "Android system", the second type system may be a "harmony os system". The second layout file may be an XML file under the "harmony os system". It is to be understood that, when the first type system is a "harmony os system", the first layout file may be an XML file under the "harmony os system", the second type system may be an "Android system", and the second layout file may be an XML file under the "Android system". The sub-tag name may be a name for identifying a sub-node in the first layout file, and the sub-tag name may belong to a start tag. The sub-tag name may also belong to a close tag. It is to be understood that the child nodes described above may refer to nodes of each hierarchy level below the root node of the first layout file. For example, when the first layout file is an XML file under the "Android system", the sub-tag name may be "TextView". The above-mentioned sub-tag name "TextView" may belong to the start tag < TextView >. The above-mentioned sub-tag name "TextView" may also belong to the close tag </TextView >. The above-mentioned sub-tag name may also be "EditText". The above-mentioned sub-tag name "EditText" may belong to the start tag < EditText >. The above-mentioned sub-tag name "EditText" may also belong to a closure tag. The name space name may be a name of a name space to which each of the sub-tag names belongs. For example, the name of the namespace to which the sub-tag names "TextView" and "EditText" belong may be "android". The above-mentioned attribute name may be a name of additional information added in the start tag. For example, the attribute name may be "layout _ width". The attribute name may also be "layout _ height". The above attribute value may be a value of additional information added in the start tag. For example, when the first layout file is an XML file under the "Android system", the attribute value may be "fitCenter". The attribute value may also be "fitStart". The target identifier may be another character or character string to be replaced. The target identifier may include: a uniform resource identifier, a system resource reference. For example, when the first layout file is an XML file under the "Android system", the uniform resource identifier may be "http:// schema. ". The system resource reference character may be a target character in a system resource reference string. For example, when the first layout file is an XML file under the "Android system", the system resource reference string may be "@ medium/lib _ search _ medium _ 70". The above target characters may include "@" and "/".
In practice, the execution subject may obtain each sub-tag name, each namespace name, each attribute name and attribute value of each sub-tag, and each object identifier by parsing the first layout file. For each of the respective sub-tag names, the execution main body may replace the sub-tag name in the first layout file with a converted sub-tag name corresponding to the sub-tag name in the preset sub-tag name conversion table in response to determining that the sub-tag name exists in the preset sub-tag name conversion table. The preset sub-tag name conversion table may be a preset table including sub-tag names in the first type system and converted sub-tag names in the second type system.
For each namespace name in the respective namespace names, the executive may replace the namespace name in the first layout file with a converted namespace name corresponding to the namespace name in a predefined namespace name conversion table in response to determining that the namespace name exists in the predefined namespace name conversion table. The preset name space name conversion table may be a preset table including name space names in a first type system and converted name space names in a second type system.
For each of the respective attribute names, the execution body may replace the attribute name in the first layout file with a converted attribute name corresponding to the attribute name in a preset attribute name conversion table in response to determining that the attribute name exists in the preset attribute name conversion table. The preset attribute name conversion table may be a preset table including attribute names in a first type system and converted attribute names in a second type system.
For each of the respective attribute values, the execution body may replace the attribute value in the first layout file with a converted attribute value corresponding to the attribute value in a preset attribute value conversion table in response to determining that the attribute value exists in the preset attribute value conversion table. The preset attribute value conversion table may be a preset table including an attribute value in a first type system and a conversion attribute value in a second type system.
For each target identifier in the target identifiers, the execution body may replace the target identifier in the first layout file with a conversion target identifier corresponding to the target identifier in a preset target identifier conversion table in response to determining that the target identifier exists in the preset target identifier conversion table. The preset target identifier conversion table may be a preset table including a target identifier in a first type system and a conversion target identifier in a second type system.
It is understood that the second layout file may be a layout file obtained by performing conversion processing on the first layout file, or may be a layout file stored after performing conversion processing on the first layout file.
As an example, the execution main body described above may replace the sub-tag name "TextView" in the first layout file with the converted sub-tag name "Text" by presetting a sub-tag name conversion table as follows. It is to be understood that the sub-tag names and the converted sub-tag names in the preset sub-tag name conversion table are not limited to those exemplified in the following preset sub-tag name conversion table.
Preset sub-tag name conversion table
Figure BDA0003102260570000111
The execution body may replace the namespace name "android" in the first layout file with the converted namespace name "ohos" by presetting a namespace name conversion table. It is to be understood that the name space names and the converted name space names in the preset name space name conversion table are not limited to those exemplified in the following preset name space name conversion table.
Preset namespace name translation table
Figure BDA0003102260570000121
The execution main body described above can convert the attribute name "layout _ width" in the first layout file into the attribute name "width" by following a preset attribute name conversion table. It is to be understood that the attribute names and the converted attribute names in the preset attribute name conversion table are not limited to those exemplified in the following preset attribute name conversion table.
Preset attribute name conversion table
Figure BDA0003102260570000122
The execution agent may convert the attribute value "fitCenter" in the first layout file into an attribute value "scale _ to _ fit _ center" through the following preset attribute value conversion table. It is to be understood that the attribute values and the converted attribute values in the preset attribute value conversion table are not limited to those exemplified in the following preset attribute value conversion table.
Preset attribute value conversion table
Figure BDA0003102260570000123
The execution main body may convert the target identifier "@" in the first layout file into the target identifier "$" by using the following preset target identifier conversion table. It is to be understood that the target identifier and the conversion target identifier in the preset target identifier conversion table are not limited to those exemplified in the following preset target identifier conversion table.
Preset target identification conversion table
Figure BDA0003102260570000131
In some optional implementation manners of some embodiments, the execution subject may perform matching processing on the first layout file to obtain each sub-tag name, each namespace name, each attribute name and attribute value of each sub-tag, and each target identifier. In practice, the execution subject may obtain each sub-tag name, each namespace name, each attribute name and attribute value of each sub-tag, and each target identifier by matching through a regular expression method. Therefore, the names of the sub-tags, the names of the namespaces, the attribute names and the attribute values of the sub-tags and the target identifications in the first layout file can be obtained in a matching mode.
In some optional implementations of some embodiments, for each of the respective sub-tag names, based on a preset sub-tag name conversion information set, where the preset sub-tag name conversion information in the preset sub-tag name conversion information set includes a pre-conversion sub-tag name and a post-conversion sub-tag name, the execution main body may perform the steps of:
a first step of determining the preset sub-tag name conversion information as target preset sub-tag name conversion information in response to the presence of the preset sub-tag name conversion information included in the set of preset sub-tag name conversion information, the pre-conversion sub-tag name corresponding to the sub-tag name. The preset sub-tag name conversion information may be information for converting the sub-tag name in the first layout file to a sub-tag name in the second type system. The correspondence between the pre-conversion sub-tag name and the sub-tag name may be: the pre-conversion sub-tag name is the same as the sub-tag name. Thus, the preset sub-tag name conversion information for converting the current sub-tag name in the preset sub-tag name conversion information set can be determined under the condition that the current sub-tag name needs to be converted.
And a second step of replacing the sub-tag name with a converted sub-tag name included in the target preset sub-tag name conversion information. In practice, the execution main body may delete the sub tag name in the first layout file first. Then, the converted sub-tag name may be added to a position in the first layout file corresponding to the sub-tag name. Thus, the current sub-tag name can be converted through the determined preset sub-tag name conversion information.
In some optional implementation manners of some embodiments, for each namespace name in the respective namespace names, based on a preset namespace name conversion information set, where the preset namespace name conversion information in the preset namespace name conversion information set includes a pre-conversion namespace name and a post-conversion namespace name, the executing body may perform the following steps:
the method comprises the steps of firstly, responding to the preset name space name conversion information set, wherein the preset name space name conversion information set comprises name space names before conversion and preset name space name conversion information corresponding to the name space names, and determining the preset name space name conversion information as target preset name space name conversion information. The preset name space name conversion information may be information for converting name space names in the first layout file into name space names in the second type system. The mapping relationship between the name space name before conversion and the name space name may be: the name space name before the conversion is the same as the name space name before the conversion. Therefore, the preset name space name conversion information used for converting the current name space name in the preset name space name conversion information set can be determined under the condition that the current name space name needs to be converted.
And replacing the name space name with the name space name after conversion included in the target preset name space name conversion information. In practice, the execution agent may first delete the name space name in the first layout file. Then, the converted name space name may be added to a position corresponding to the name space name in the first layout file. Therefore, the current name space name can be converted through the determined preset name space name conversion information.
In some optional implementations of some embodiments, for each attribute name in the attribute names and attribute values, based on a preset attribute name conversion information set, where preset attribute name conversion information in the preset attribute name conversion information set includes a pre-conversion attribute name and a post-conversion attribute name, the executing body may perform the following steps:
the method comprises the steps of firstly, responding to the preset attribute name conversion information set, wherein the preset attribute name conversion information set comprises the attribute name before conversion and the attribute name corresponding to the attribute name, and determining the preset attribute name conversion information as target preset attribute name conversion information. The preset attribute name conversion information may be information for converting an attribute name in the first layout file into an attribute name in the second type system. The correspondence between the attribute name before conversion and the attribute name may be: the pre-conversion attribute name is the same as the attribute name. Therefore, the preset attribute name conversion information used for converting the current attribute name in the preset attribute name conversion information set can be determined under the condition that the current attribute name needs to be converted.
And replacing the attribute name with the converted attribute name included in the target preset attribute name conversion information. In practice, the execution agent may first delete the attribute name in the first layout file. Then, the converted attribute name may be added to a position in the first layout file corresponding to the attribute name. Therefore, the current attribute name can be converted through the determined preset attribute name conversion information.
For each attribute value in the attribute names and the attribute values, converting an information set based on a preset attribute value, wherein the preset attribute value conversion information in the preset attribute value conversion information set comprises a pre-conversion attribute value and a post-conversion attribute value, and executing the following steps:
first, in response to the preset attribute value conversion information set, which includes the attribute value before conversion and the preset attribute value conversion information corresponding to the attribute value, the preset attribute value conversion information is determined as the target preset attribute value conversion information. The preset attribute value conversion information may be information for converting an attribute value in the first layout file into an attribute value in a second type system. The correspondence between the attribute values before conversion and the attribute values may be: the pre-conversion attribute value is the same as the attribute value. Therefore, the preset attribute value conversion information used for converting the current attribute value in the preset attribute value conversion information set can be determined under the condition that the current attribute value needs to be converted.
And replacing the attribute value with the converted attribute value included in the target preset attribute value conversion information. In practice, the execution agent may delete the attribute value in the first layout file first. Then, the converted attribute value may be added to a position in the first layout file corresponding to the attribute value. Therefore, the current attribute value can be converted through the determined preset attribute value conversion information.
In some optional implementation manners of some embodiments, for each target identifier in the target identifiers, based on a preset identifier conversion information set, where preset identifier conversion information in the preset identifier conversion information set includes a pre-conversion identifier and a post-conversion identifier, the execution main body may perform the following steps:
first, in response to that preset identifier conversion information corresponding to the target identifier exists in the preset identifier conversion information set, determining the preset identifier conversion information as target preset identifier conversion information. The preset identifier conversion information may be information for converting the target identifier in the first layout file into the target identifier in the second type system. The correspondence between the pre-conversion identifier and the target identifier may be: the pre-conversion identifier is the same as the target identifier. Therefore, the preset identification conversion information used for converting the current target identification in the preset identification conversion information set can be determined under the condition that the current target identification needs to be converted.
And replacing the target identification with a converted identification included in the target preset identification conversion information. In practice, the execution subject may delete the target identifier in the first layout file first. Then, the converted identifier may be added to a position corresponding to the target identifier in the first layout file. Therefore, the current target identification can be converted through the determined preset identification conversion information.
Through step 3011, the names of the respective sub-tags, the name space names, the respective attribute names and attribute values of the sub-tags, and the target identifiers in the first layout file may be automatically transformed to automatically generate a second layout file adapted to the second type system.
Step 3012, add the second layout file to the second target file directory.
In some embodiments, the execution agent may add the second layout file to a second target file directory. The second target file directory may be a file directory for storing the second layout file. It is to be understood that the second target file directory may be the same as the first target file directory or may be different from the first target file directory. In practice, the execution agent may copy the second layout file to the second destination file directory. Therefore, the second layout file obtained after automatic conversion can be added to the corresponding file directory for the second type system to render the page view.
The above embodiments of the present disclosure have the following advantages: by the layout file conversion method of some embodiments of the disclosure, the page view development efficiency is improved, and development resources are saved. Specifically, the reasons for the low development efficiency and the waste of development resources of the page view are as follows: the layout file under another type of system needs to be rewritten according to the layout file written earlier, which causes lower development efficiency of the page view and waste of development resources. Based on this, the layout file conversion method of some embodiments of the present disclosure performs, for each first layout file in the first set of layout files in the first target file directory, the following conversion steps: first, based on each sub-tag name, each namespace name, each attribute name and attribute value of each sub-tag, and each object identifier in the first layout file, the first layout file is converted to obtain a converted first layout file as a second layout file. The first layout file is used for rendering the page view under the first type system, and the second layout file is used for rendering the page view under the second type system. Therefore, the name of each sub-label, the name space name, the name of each attribute of the sub-label, the attribute value and the target identifier in the first layout file can be automatically converted, so that the second layout file which is suitable for the second type system can be automatically generated. Then, the second layout file is added to the second target file directory. Therefore, the second layout file obtained after automatic conversion can be added to the corresponding file directory for the second type system to render the page view. And because the first layout file can be automatically converted into the second layout file, the layout file does not need to be rewritten when the page view development is carried out under the second type system. Therefore, the development efficiency of the page view is improved, and development resources are saved.
With further reference to FIG. 4, a flow 400 of further embodiments of a layout file conversion method is illustrated. The process 400 of the layout file conversion method includes the following steps:
step 401, sending a preset prompt message to an associated display device.
In some embodiments, an executing entity (e.g., the computing device 101 shown in fig. 1) of the layout file conversion method may send the preset prompting information to the associated display device through a wired connection manner or a wireless connection manner. The preset prompting information is used for prompting a user to add a first layout file set to the first target file directory. For example, the prompt message may be "please add the layout file to be converted under the file directory [ D: \ aa \ bb ]. The display device may be a device having a display function. For example, the display device may be a display screen associated with the execution subject. Thus, the user can be prompted to add the layout file to be converted to the designated file directory.
Step 402, receiving second layout file directory configuration information.
In some embodiments, the execution principal may receive second layout file directory configuration information. In practice, the execution subject may receive the second layout file directory configuration information input by the user. The second layout file directory configuration information may be address information of the second layout file directory. For example, the second layout file directory configuration information may be "D: \ aa \ cc". Thus, the user can set the second layout file directory by himself.
Step 403, in response to the existence of the file directory corresponding to the second layout file directory configuration information, determining the file directory as a second target file directory.
In some embodiments, the executing entity may determine the file directory as the second target file directory in response to the file directory corresponding to the second layout file directory configuration information. Thus, the local file directory can be directly determined as the second target file directory under the condition that the file directory set by the user exists locally.
Step 404, in response to that there is no file directory corresponding to the second layout file directory configuration information, creating a file directory as a second target file directory.
In some embodiments, the execution agent may create the file directory as a second target file directory in response to the absence of a file directory corresponding to the second layout file directory configuration information. Therefore, the file directory can be created locally as the second target file directory under the condition that the file directory set by the user does not exist locally.
In step 405, for each first layout file in the first set of layout files in the first target file directory, the following conversion steps are performed: performing conversion processing on the first layout file based on each sub-tag name, the name space name, each attribute name and attribute value of each sub-tag and each target identifier in the first layout file to obtain a first layout file after conversion processing, wherein the first layout file is used as a second layout file; the second layout file is added to the second target file directory.
In some embodiments, the specific implementation of step 405 and the technical effect brought by the implementation may refer to step 301 in those embodiments corresponding to fig. 3, which are not described herein again.
As can be seen from fig. 4, compared with the description of some embodiments corresponding to fig. 3, the flow 400 of the layout file conversion method in some embodiments corresponding to fig. 4 embodies the steps of extending the first target file directory and the second target file directory. Thus, the solutions described in these embodiments may prompt the user to add the layout file to be converted to the specified file directory. The user can set a second layout file directory for storing the converted layout files.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a layout file conversion apparatus, which correspond to those shown in fig. 3, and which may be applied in various electronic devices in particular.
As shown in fig. 5, the layout file conversion apparatus 500 of some embodiments includes: an execution unit 501. Wherein the execution unit 501 is configured to, for each first layout file in the first set of layout files in the first target file directory, perform the following conversion steps: a conversion unit 5011, configured to perform conversion processing on the first layout file based on each sub-tag name, each namespace name, each attribute name and attribute value of each sub-tag, and each object identifier in the first layout file, to obtain a first layout file after the conversion processing as a second layout file, where the first layout file is used for rendering a page view under a first type system, and the second layout file is used for rendering a page view under a second type system; the adding unit 5012 is configured to add the second layout file to the second target file directory.
In an optional implementation manner of some embodiments, before the executing unit 501, the layout file converting apparatus 500 may further include: a sending unit (not shown in the figure) configured to send a preset prompting message to the associated display device, wherein the preset prompting message is used for prompting the user to add the first layout file set to the first target file directory.
In an optional implementation manner of some embodiments, before the executing unit 501, the layout file converting apparatus 500 may further include: a receiving unit and a determining unit (not shown in the figure). Wherein the receiving unit is configured to receive second layout file directory configuration information; the determining unit is configured to determine the file directory as a second target file directory in response to the file directory corresponding to the second layout file directory configuration information.
In an optional implementation manner of some embodiments, before the executing unit 501, the layout file converting apparatus 500 may further include: a creating unit (not shown in the figure) configured to create the file directory as a second target file directory in response to the absence of the file directory corresponding to the second layout file directory configuration information.
In an alternative implementation of some embodiments, before the converting unit 5011, the converting step further comprises: and matching the first layout file to obtain each sub-label name, each name space name, each attribute name and attribute value of each sub-label and each target identifier.
In an alternative implementation of some embodiments, the conversion unit 5011 may include: a first conversion sub-unit (not shown in the figure) configured to perform, for each of the respective sub-tag names, the following steps based on a preset sub-tag name conversion information set in which the preset sub-tag name conversion information in the preset sub-tag name conversion information set includes a pre-conversion sub-tag name and a post-conversion sub-tag name: determining preset sub-tag name conversion information as target preset sub-tag name conversion information in response to the presence of preset sub-tag name conversion information included in the preset sub-tag name conversion information set, the pre-conversion sub-tag name corresponding to the sub-tag name; and replacing the sub-tag name with the converted sub-tag name included in the target preset sub-tag name conversion information.
In an alternative implementation of some embodiments, the conversion unit 5011 may include: a second converting subunit (not shown in the figures) configured to, for each name space name in the name space names, convert an information set based on a preset name space name, where preset name space name conversion information in the preset name space name conversion information set includes a name space name before conversion and a name space name after conversion, execute the following steps: responding to the preset name space name conversion information set, wherein the preset name space name conversion information comprises name space names before conversion and corresponding to the name space names, and determining the preset name space name conversion information as target preset name space name conversion information; and replacing the name space name with the name space name after conversion included in the target preset name space name conversion information.
In an alternative implementation of some embodiments, the conversion unit 5011 may include: a third conversion sub-unit and a fourth conversion sub-unit (not shown in the figure). Wherein the third converting subunit is configured to, for each attribute name in the attribute names and attribute values, convert an information set based on a preset attribute name, where preset attribute name conversion information in the preset attribute name conversion information set includes a pre-conversion attribute name and a post-conversion attribute name, and execute the following steps: responding to the preset attribute name conversion information set, wherein the preset attribute name conversion information corresponding to the attribute name and the attribute name before conversion exists, and determining the preset attribute name conversion information as target preset attribute name conversion information; and replacing the attribute name with the converted attribute name included in the target preset attribute name conversion information. The fourth conversion subunit is configured to, for each attribute value in the attribute names and attribute values, perform the following steps based on a preset attribute value conversion information set, where the preset attribute value conversion information in the preset attribute value conversion information set includes a pre-conversion attribute value and a post-conversion attribute value: responding to the preset attribute value conversion information set, wherein the preset attribute value conversion information corresponding to the attribute value and the attribute value before conversion exists, and determining the preset attribute value conversion information as target preset attribute value conversion information; and replacing the attribute value with the converted attribute value included in the target preset attribute value conversion information.
In an alternative implementation of some embodiments, the conversion unit 5011 may include: a fifth converting subunit (not shown in the figures), configured to, for each of the target identifiers, based on a preset identifier conversion information set, where the preset identifier conversion information in the preset identifier conversion information set includes a pre-conversion identifier and a post-conversion identifier, perform the following steps: responding to the preset identification conversion information set, wherein the preset identification conversion information corresponding to the target identification and the pre-conversion identification exist, and determining the preset identification conversion information as target preset identification conversion information; and replacing the target identification with the converted identification included in the target preset identification conversion information.
It will be understood that the elements described in the apparatus 500 correspond to various steps in the method described with reference to fig. 3. Thus, the operations, features and resulting advantages described above with respect to the method are also applicable to the apparatus 500 and the units included therein, and are not described herein again.
Referring now to FIG. 6, a block diagram of an electronic device (e.g., computing device 101 of FIG. 1)600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In some such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of some embodiments of the present disclosure.
It should be noted that the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: for each first layout file in the first set of layout files in the first target file directory, performing the following conversion steps: converting the first layout file based on each sub-tag name, name space name, each attribute name and attribute value of each sub-tag and each target identifier in the first layout file to obtain a converted first layout file as a second layout file, wherein the first layout file is used for rendering a page view under a first type system, and the second layout file is used for rendering a page view under a second type system; and adding the second layout file to a second target file directory.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by software, and may also be implemented by hardware. The described units may also be provided in a processor, and may be described as: a processor includes an execution unit. Where the names of the cells do not in some cases constitute a limitation of the cell itself, for example, the execution cell may also be described as "for each first layout file in the first set of layout files in the first target file directory, performing the following conversion steps: converting the first layout file based on each sub-tag name, name space name, each attribute name and attribute value of each sub-tag and each target identifier in the first layout file to obtain a converted first layout file as a second layout file, wherein the first layout file is used for rendering a page view under a first type system, and the second layout file is used for rendering a page view under a second type system; a unit that adds the above-described second layout file to the second target file directory ".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (12)

1. A layout file conversion method, comprising:
for each first layout file in the first set of layout files in the first target file directory, performing the following conversion steps:
converting the first layout file based on each sub-tag name, each name space name, each attribute name and attribute value of each sub-tag and each target identifier in the first layout file to obtain a converted first layout file as a second layout file, wherein the first layout file is used for rendering a page view under a first type system, and the second layout file is used for rendering the page view under a second type system;
adding the second layout file to a second target file directory.
2. The method of claim 1, wherein prior to said performing the converting step, the method further comprises:
and sending preset prompt information to the associated display equipment, wherein the preset prompt information is used for prompting a user to add a first layout file set to the first target file directory.
3. The method of claim 1, wherein prior to said performing the converting step, the method further comprises:
receiving second layout file directory configuration information;
and determining the file directory as a second target file directory in response to the existence of the file directory corresponding to the second layout file directory configuration information.
4. The method of claim 3, wherein prior to said performing the converting step, the method further comprises:
and in response to the absence of the file directory corresponding to the second layout file directory configuration information, creating the file directory as a second target file directory.
5. The method of claim 1, wherein prior to said converting said first layout file, said converting step further comprises:
and matching the first layout file to obtain each sub-label name, each name space name, each attribute name and attribute value of each sub-label and each target identifier.
6. The method of claim 1, wherein the converting the first layout file comprises:
for each of the respective sub-tag names, based on a preset sub-tag name conversion information set in which the preset sub-tag name conversion information in the preset sub-tag name conversion information set includes a pre-conversion sub-tag name and a post-conversion sub-tag name, performing the steps of:
in response to the presence of preset sub-tag name conversion information including a pre-conversion sub-tag name corresponding to the sub-tag name in the preset sub-tag name conversion information set, determining the preset sub-tag name conversion information as target preset sub-tag name conversion information;
and replacing the sub-tag name with the converted sub-tag name included in the target preset sub-tag name conversion information.
7. The method of claim 1, wherein the converting the first layout file comprises:
for each name space name in the name space names, converting an information set based on a preset name space name, wherein the preset name space name conversion information in the preset name space name conversion information set comprises a name space name before conversion and a name space name after conversion, and executing the following steps:
responding to the preset name space name conversion information set, wherein the preset name space name conversion information comprises name space names before conversion and preset name space name conversion information corresponding to the name space names, and determining the preset name space name conversion information as target preset name space name conversion information;
and replacing the name space name with the name space name after conversion included in the target preset name space name conversion information.
8. The method of claim 1, wherein the converting the first layout file comprises:
for each attribute name in the attribute names and the attribute values, based on a preset attribute name conversion information set, wherein the preset attribute name conversion information in the preset attribute name conversion information set comprises attribute names before conversion and attribute names after conversion, executing the following steps:
responding to the preset attribute name conversion information set, wherein the preset attribute name conversion information corresponding to the attribute name and the attribute name before conversion exists, and determining the preset attribute name conversion information as target preset attribute name conversion information;
replacing the attribute name with the converted attribute name included in the target preset attribute name conversion information;
for each attribute value in the attribute names and attribute values, converting an information set based on a preset attribute value, wherein the preset attribute value conversion information in the preset attribute value conversion information set comprises a pre-conversion attribute value and a post-conversion attribute value, and executing the following steps:
responding to the preset attribute value conversion information set, wherein the preset attribute value conversion information corresponding to the attribute value and the attribute value before conversion exists, and determining the preset attribute value conversion information as target preset attribute value conversion information;
and replacing the attribute value with the converted attribute value included in the target preset attribute value conversion information.
9. The method of claim 1, wherein the converting the first layout file comprises:
for each target identifier in the target identifiers, based on a preset identifier conversion information set, wherein the preset identifier conversion information in the preset identifier conversion information set comprises a pre-conversion identifier and a post-conversion identifier, executing the following steps:
responding to the preset identification conversion information set, wherein the preset identification conversion information corresponding to the target identification and the pre-conversion identification exist, and determining the preset identification conversion information as the target preset identification conversion information;
and replacing the target identification with the converted identification included in the target preset identification conversion information.
10. A layout file conversion apparatus comprising:
an execution unit configured to, for each first layout file in the first set of layout files in the first target file directory, perform the following conversion steps:
the conversion unit is configured to perform conversion processing on the first layout file based on each sub-tag name, each name space name, each attribute name and attribute value of each sub-tag and each target identifier in the first layout file to obtain a first layout file after the conversion processing as a second layout file, wherein the first layout file is used for rendering a page view under a first type system, and the second layout file is used for rendering a page view under a second type system;
an adding unit configured to add the second layout file to a second target file directory.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
12. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-9.
CN202110627633.5A 2021-04-09 2021-06-04 Layout file conversion method, device, electronic equipment and computer readable medium Pending CN113157276A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110386054 2021-04-09
CN2021103860546 2021-04-09

Publications (1)

Publication Number Publication Date
CN113157276A true CN113157276A (en) 2021-07-23

Family

ID=76875799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110627633.5A Pending CN113157276A (en) 2021-04-09 2021-06-04 Layout file conversion method, device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113157276A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222476A (en) * 2007-01-08 2008-07-16 华为技术有限公司 Expandable markup language file editor, file transferring method and system
CN105574049A (en) * 2014-10-30 2016-05-11 阿里巴巴集团控股有限公司 Page processing method, device and system of mobile applications
US9558164B1 (en) * 2008-12-31 2017-01-31 F5 Networks, Inc. Methods and system for converting WSDL documents into XML schema
CN106843842A (en) * 2016-12-23 2017-06-13 光锐恒宇(北京)科技有限公司 The update method and device of a kind of application profiles
CN108628900A (en) * 2017-03-23 2018-10-09 腾讯科技(深圳)有限公司 A kind of method and relevant apparatus of data format acquisition
CN109716294A (en) * 2016-06-06 2019-05-03 赫克斯冈技术中心 With the user interface for moving mini label

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222476A (en) * 2007-01-08 2008-07-16 华为技术有限公司 Expandable markup language file editor, file transferring method and system
US9558164B1 (en) * 2008-12-31 2017-01-31 F5 Networks, Inc. Methods and system for converting WSDL documents into XML schema
CN105574049A (en) * 2014-10-30 2016-05-11 阿里巴巴集团控股有限公司 Page processing method, device and system of mobile applications
CN109716294A (en) * 2016-06-06 2019-05-03 赫克斯冈技术中心 With the user interface for moving mini label
CN106843842A (en) * 2016-12-23 2017-06-13 光锐恒宇(北京)科技有限公司 The update method and device of a kind of application profiles
CN108628900A (en) * 2017-03-23 2018-10-09 腾讯科技(深圳)有限公司 A kind of method and relevant apparatus of data format acquisition

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈天伟;彭凌西;: "基于HTML5的移动终端布局解析器的设计与实现", 实验科学与技术, no. 04, 16 May 2017 (2017-05-16) *

Similar Documents

Publication Publication Date Title
CN110019350B (en) Data query method and device based on configuration information
CN111447257B (en) Message conversion method and device
CN113760536A (en) Data caching method and device, electronic equipment and computer readable medium
CN113268955A (en) Message conversion method and device
CN114461247A (en) Hot update method, device, electronic equipment and computer readable medium
CN116303608A (en) Data processing method and device for application service
CN113190517B (en) Data integration method and device, electronic equipment and computer readable medium
CN111191225B (en) Method, device, medium and electronic equipment for switching isolated objects
CN112631588A (en) File generation method and device, electronic equipment and computer readable medium
CN112948138A (en) Method and device for processing message
CN113760487B (en) Service processing method and device
CN113157276A (en) Layout file conversion method, device, electronic equipment and computer readable medium
CN113760927A (en) Data processing method and device, electronic equipment and computer readable medium
CN111753238A (en) Data mapping method and device and electronic equipment
CN112099841A (en) Method and system for generating configuration file
CN112328841A (en) Document processing method and device, electronic equipment and storage medium
CN111580890A (en) Method, apparatus, electronic device, and computer-readable medium for processing features
CN112306984A (en) Data source routing method and device
CN115374320B (en) Text matching method and device, electronic equipment and computer medium
CN111314457B (en) Method and device for setting virtual private cloud
CN112311833B (en) Data updating method and device
CN111221513B (en) Method, device, medium and electronic equipment for adjusting cascading style sheet
CN113472565A (en) Method, device, equipment and computer readable medium for expanding server function
CN115391358A (en) Array updating method and device, electronic equipment and computer readable medium
CN112069438A (en) Message merging method, message processing method and device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination