Object Protocol Syntax for XML Access Ambiguity
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Compilers face ambiguity in determining whether a user intends to access objects using a primary or secondary object model, leading to confusion and clumsy explicit accesses, especially in programming languages that allow access to XML objects using the same notation for both models.
Innovation Solution
A special syntax is introduced to differentiate between primary and secondary object model accesses using distinct operators, such as '/' instead of '.' for XML objects, allowing dynamic generation of member names and specifying the type of secondary object model being used, like '<' for elements and '@' for attributes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If the same member access notation is used for both primary and secondary object models, then the syntax is simplified and unified, but ambiguity arises as to which model the user intends to access
Solution Approach 1:
The patent segments the member access notation into distinct syntax forms: primary object access uses dot notation (e.g., obj.member), while secondary object access uses bracket notation with string indices (e.g., obj["member"]). This segmentation eliminates ambiguity by providing visually distinct syntax for different access types, allowing the compiler to correctly identify the intended object model without confusion.
2Loss of information
If explicit accesses through the primary object model are used to access secondary objects, then ambiguity is resolved, but the access becomes clumsy and less intuitive
Solution Approach 1:
The patent introduces an intermediary syntax mechanism - the bracket notation with string indices - that serves as a mediator between the user's intent to access secondary objects and the compiler's need to distinguish access types. This intermediary syntax is both unambiguous to the compiler and intuitive to users, avoiding the clumsiness of explicit primary model accesses while maintaining clarity of intent.
3Loss of information
If reserved syntax is used for primary object access, then primary access is unambiguous, but valid secondary object element names cannot be used
Solution Approach 1:
The patent changes the syntactic parameter for secondary object access from dot notation to bracket notation with string indices. This parameter change allows element names containing special characters like hyphens (e.g., "foo-bar") to be used freely in secondary objects, as the bracket notation with quoted strings does not conflict with reserved syntax. The syntax transformation from obj.member to obj["member"] enables full flexibility in element naming while maintaining unambiguous access model distinction.
Data Source
AI summary
A special syntax is developed to differentiate between accesses to a primary and one or more secondary object protocols in a programming language. The syntax allows the compiler to differentiate between the primary and secondary object model based on syntax, rather than type. The syntax is created in such a way as to approximate the syntax of the secondary object model, and allows the user to dynamically generate member names.


