CSS Selector API Extension via XPath Translation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing web content management systems struggle to optimize web pages with heavy JavaScript reliance, as some client devices cannot implement JavaScript, leading to functionality issues, and CSS selector expressions are difficult to translate into efficient XPath expressions.
Innovation Solution
A method and device that extend the selector API by transforming CSS selector expressions into equivalent XPath expressions or using extension functions, allowing full translation and evaluation in an emulated JavaScript environment, enabling efficient processing without requiring specific CSS selector execution code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If JavaScript is removed from web pages for client devices that cannot implement JavaScript, then web pages can be delivered to devices with JavaScript limitations, but the web pages will not function properly when they depend on JavaScript for form validation, data retrieval, and dynamic content generation
Solution Approach 1:
The patent introduces an intermediary JavaScript emulator on the server side that acts as a mediator between the static HTML delivered to clients and the JavaScript functionality originally intended to run on client devices. The emulator executes JavaScript code server-side and generates appropriate responses, thereby bridging the gap between devices that cannot run JavaScript and web applications that require JavaScript functionality.
2Productivity
If CSS selector expressions are translated into XPath expressions for efficient processing in an emulated JavaScript environment, then processing efficiency is improved, but many CSS selector expressions cannot be translated into equivalent XPath expressions
Solution Approach 1:
The patent transforms CSS selector expressions into XPath expressions by changing the parameter representation from CSS syntax to XPath syntax. The system analyzes CSS selector parameters (selectors, combinators, pseudo-classes) and converts them into equivalent XPath expressions with appropriate axis, node tests, and predicates, thereby enabling efficient XPath processing while maintaining CSS selector functionality.
Solution Approach 2:
The patent introduces an intermediary translation layer that converts CSS selector expressions into XPath expressions. This intermediary translator acts as a bridge between the CSS selector API and the XPath processor, enabling CSS selectors to be evaluated efficiently using XPath while preserving the original CSS selector semantics and functionality.
3Adaptability or versatility
If CSS selector expressions are used in an emulated JavaScript environment, then the selector API functionality is available, but the implementation becomes complex and requires specific code or libraries
Solution Approach 1:
The patent replaces the mechanical implementation of CSS selector evaluation (requiring specific code and libraries) with a substitution approach: CSS selectors are translated into XPath expressions, which are then evaluated by an existing XPath processor. This substitution eliminates the need for complex CSS selector implementation code while preserving the selector API functionality.
Data Source
AI summary
A method, non-transitory computer readable medium, and web content management server device that receives a cascading style sheet (CSS) selector expression comprising a plurality of expression components. Whether an equivalent XML path language (XPath) expression can be generated for each of the expression components is determined. Each of the expression components for which an equivalent XPath expression cannot be generated is transformed into a transformed expression comprising at least one XPath expression and an extension function.


