Markup Language Parser Selective String Object Creation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional markup language parsers unnecessarily expend processing resources by creating string objects and copying data into buffers even when applications do not require them, leading to inefficient data processing.
Innovation Solution
Implementing a parser configuration where string objects are created and data are copied only upon request from the application, using a 'listener' mechanism to manage buffer data availability and employing two types of buffers to optimize data storage and retrieval based on application needs.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of energy
If the scanner creates string objects and copies data into buffers for all tokens processed, then data completeness is ensured, but processing resources are wasted when applications do not require all data
Solution Approach 1:
The application is given the opportunity to indicate in advance which types of data it needs before the parser processes the markup language data. This allows the parser to prepare only the necessary string objects and buffer data, avoiding unnecessary processing while ensuring data completeness for required elements.
Solution Approach 2:
The parser dynamically adjusts its processing behavior based on the application's indicated data needs. Instead of statically processing all tokens uniformly, the system modifies its operation to create string objects and copy buffer data selectively, optimizing resource usage while maintaining reliability for required data.
2Productivity
If the parser processes all markup language data through tokenization and string object creation, then data availability is maximized, but processing time increases
Solution Approach 1:
The parser performs only the necessary portion of processing based on application needs. Instead of processing all tokens to create all possible string objects, the system performs partial processing to create only those string objects and copy only those buffer data that the application has indicated it requires, thereby reducing processing time while maintaining productivity for needed data.
3Ease of operation
If the scanner creates string objects for every token, then data accessibility is improved, but memory usage increases unnecessarily
Solution Approach 1:
The system extracts and creates string objects only for the specific data elements that the application has indicated it needs. Instead of creating string objects for all tokens, the parser selectively extracts and processes only the relevant portions, reducing memory usage while maintaining data accessibility for required elements.
Data Source
AI summary
A markup language parser processes markup language data and provides processed data to an application. A reader is configured to tokenize the markup language data and store resulting tokens in a buffer associated with the reader. A scanner is configured to create string objects based on the tokens and to provide the created string objects to an application. The scanner is further configured to determine a need by the application for the string objects. For each at least some of the string objects created by the scanner, the scanner is configured to selectively create those string objects based on a determination of the need by the application for the string objects.


