Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

XML analysis method and device

A DOM tree and element technology, applied in special data processing applications, instruments, electrical digital data processing, etc., can solve problems such as XML occupying too much system memory

Active Publication Date: 2017-10-27
BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] The technical problem to be solved by the present invention is to provide a method and device for parsing XML, which overcomes the defect that parsing and copying XML takes up too much system memory 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
  • XML analysis method and device
  • XML analysis method and device
  • XML analysis method and device

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0087] In the first embodiment of the present invention, a method for parsing XML, such as figure 1 shown, including the following specific steps:

[0088] Step S101, defining a character string indication structure.

[0089] Wherein, the string indication structure includes: the content length Length of the string, the buffer pointer Buffer of the string, and the memory allocation mark MaximumLength of the string buffer.

[0090] For example:

[0091]

[0092]

[0093] As another example, using the Windows native structure UNICODE_STRING:

[0094]

[0095] Step S102, define the DOM tree node structure of the document object model, and in the DOM tree node structure, indicate the character strings of each element in the XML document through the string indicator structure, so as to reuse the text buffer of the XML document.

[0096] Among them, the DOM tree node structure includes: element name Name member, element text content Content member, element attribute list...

no. 2 example

[0125] In the second embodiment of the present invention, a method for parsing XML includes the following specific steps:

[0126] Step S201, defining a character string indication structure.

[0127] Wherein, the string indication structure includes: the content length Length of the string, the buffer pointer Buffer of the string, and the memory allocation mark MaximumLength of the string buffer.

[0128] Step S202, define the DOM tree node structure of the document object model, and in the DOM tree node structure, indicate the character strings of each element in the XML document through the string indicator structure, so as to reuse the text buffer of the XML document.

[0129] Among them, the DOM tree node structure includes: element name Name member, element text content Content member, element attribute list Attributes member and element relationship Relationship member;

[0130] The type of the element Name member is a string indicating structure;

[0131] The type of...

no. 3 example

[0161] In the third embodiment of the present invention, a device for parsing XML, such as Figure 2 ~ Figure 3 shown, including the following components:

[0162] The first definition module 100 is configured to define a character string indication structure.

[0163] Wherein, the string indication structure includes: the content length Length of the string, the buffer pointer Buffer of the string, and the memory allocation mark MaximumLength of the string buffer.

[0164] For example:

[0165]

[0166] As another example, using the Windows native structure UNICODE_STRING:

[0167]

[0168] The second definition module 200 is used to define the DOM tree node structure of the document object model, and in the DOM tree node structure, the character string of each element in the XML document is indicated by the string indication structure, so as to reuse the text buffer of the XML document.

[0169] Among them, the DOM tree node structure includes: element name Name membe...

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 invention provides an XML analysis method and device. The method comprises the steps that first, a string instruction structure is defined; second, a DOM tree node structure of a document object model is defined, and a string of all elements in an XML document is instructed through the string instruction structure in the DOM tree node structure to multiplex a text buffer area of the XML document; and third, recursive analysis is performed through the text buffer area of the XML document, and the DOM tree node structure is used to construct a DOM tree. Through the XML analysis method and device, when the DOM tree of the XML document is realized, a string with external length is used to represent an instruction string on the node data structure, and therefore the purpose of multiplexing the text buffer area of the XML document is achieved; under the condition that system resources are sensitive, memory occupation can be effectively lowered, frequent allocation and release of a memory are avoided, and therefore system efficiency is improved; and the string with length has higher efficiency in the process of performing corresponding comparison, search and other calculation.

Description

technical field [0001] The invention relates to the technical field of information processing, in particular to a method and device for parsing XML. Background technique [0002] XML (Extensible Markup Language, Extensible Markup Language) is a markup language used to mark electronic documents to make them structural. XML is self-describing, especially suitable for sharing data between different systems, platforms and languages, and is widely used in various data processing, communication and data storage software. [0003] XML DOM (Document Object Model, Document Object Model) is a standard method for accessing and manipulating XML documents recommended by W3C (World Wide Web Consortium, World Wide Web Consortium). DOM loads XML documents into a tree structure, accesses all elements in XML, modifies or deletes elements in XML, or creates new elements in XML. After the XML is loaded into the DOM tree, XPath (XML path language) can also be used to conveniently locate the el...

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
IPC IPC(8): G06F17/30
CPCG06F16/81
Inventor 周国华
Owner BEIJING TOPSEC NETWORK SECURITY TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products