Method for filtrating illegal label in marker language
A markup language and labeling technology, applied in the field of fault-tolerant analysis, can solve the problems of lack of error handling mechanism and inconvenient browsing for users, and achieve the effects of enhancing browsing comfort, improving recovery ability, and improving robustness
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0033] A method for filtering illegal tags in a markup language, specifically comprising the following steps:
[0034] 1. Record from the input data stream composed of tags: the position of the tag that is currently being parsed; the position of the last parsed tag; all the start tags that have not yet been parsed to their end tags; and during the parsing process, Continuously update the above three record information;
[0035] 2. The first non-annotated and legal tag curTag read from the input data stream composed of tags is the input parameter of the recursive function,
[0036] 3. Store the name and attributes of curTag in a specific data structure,
[0037] 4. Read the next tag from the input data stream, which is recorded as nextTag. If the input data stream has ended, nextTag is empty.
[0038] 5. If the next tag read in nextTag is the start tag, then assign the value of nextTag to curTag, and return to step 2 to start a new recursion.
[0039] 6. If the...
Embodiment 2
[0054] If the input tag stream is:
[0055]
[0056]
[0057]
[0058] This wml page has a syntax error: tag missing closing tag .
[0059] Use the 10 steps in Example 1 to parse the page. When proceeding to step 8, it was found that although no The closing tag of the , but it is the opening tag that appeared before The end tag of , so the data flow is rolled back, so that the nextTag read next time is still , and this recursion ends. thus in Virtually inserts a , allowing parsing to continue successfully.
Embodiment 3
[0061] If the input tag stream is:
[0062]
[0063]
[0064]
[0065]
[0066]
[0067] There is a syntax error in this wml page: the tag does not have a matching start tag.
[0068] Use the 10 steps in Example 1 to parse the page. When proceeding to step 9, it is found that it is not the end tag of , and there is no start tag before appears, so ignore this label and jump to step 4 to continue reading the next label , so that parsing can continue successfully.
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 