A structural adviser for the XML document authoring

Boris ChidlovskiiACM Symposium on Document Engineering 2003 · DOI

TL;DR

This paper introduces a "structural adviser" for XML document authoring that helps users by suggesting the next most likely tag or tree pattern. It addresses the tedious nature of manual XML creation, especially when schemas are too general or absent, by mining existing document structures to provide context-aware recommendations.

What Problem Does This Paper Address?

Creating structured documents in XML can be a time-consuming and error-prone process due to the verbosity of XML markup. While XML editors offer some assistance, they often fall short during the authoring phase. Existing schemas, while useful for validation, can be overly general and don't always capture the specific patterns users actually employ. This leaves a gap in providing intelligent, context-aware guidance to authors as they build XML documents, particularly when dealing with less constrained or schema-less scenarios.

Methods

The core of the proposed solution is a "structural adviser" that intervenes at any point during document authoring. It employs a data mining approach to identify "suggestion patterns" from sample data (either existing documents or the author's own history). The adviser then uses these patterns to suggest the most relevant tag or tree structure for the current cursor position.

Key methodological components include:

  • Data Mining for Suggestion Patterns: The system analyzes sample XML data to extract recurring tree-like structures. This can be done offline (pre-processing a collection) or online (incrementally as the author works).
  • Contextual Advising: Suggestions are highly context-dependent, considering the current cursor position and its surrounding elements (e.g., parent tags, preceding siblings).
  • Similarity and Gain Functions: Novel functions are introduced to measure the similarity between a candidate suggestion and learned patterns, and a "gain function" estimates the relevance of a suggestion, balancing size and frequency.
  • Suggestion Index: An efficient data structure, based on extended prefix automata, is proposed for storing and quickly retrieving optimal suggestions.

Datasets

The paper describes experiments using two types of datasets:

  • Shakespeare Collection: A set of 39 plays in XML format.
  • XBench Database Generator: Used to create synthetic XML data. Two types were generated:
  • Data-centric: Representing e-commerce or transactional data.
  • Document-centric: Representing book collections or news articles. Experiments were conducted with both small (10MB) and normal (100MB) sizes for these collections.

Key Insights and Ideas

  • Mining Structure for Authoring: The fundamental idea is that by analyzing how humans actually structure XML documents (rather than just what a schema allows), we can build more effective authoring tools.
  • Context is King: The effectiveness of suggestions dramatically improves when considering the immediate context of the cursor, including parent and sibling elements. This allows for more nuanced and accurate predictions.
  • Balancing Pattern Size and Frequency: A key challenge is that smaller patterns are more frequent but less impactful, while larger patterns are less frequent but offer greater efficiency gains if accepted. The proposed gain function aims to find an optimal trade-off.
  • Prefix Automata for Efficient Retrieval: Using extended prefix automata allows for rapid lookup of relevant suggestions, crucial for real-time interactive authoring.

Key Results

The adviser demonstrated significant effectiveness in reducing the cost of document structure generation:

  • Off-line Training: Achieved match ratios around 0.98 for data-centric XML and around 0.90 for document-centric XML (Shakespeare). Gain ratios were substantial, with values indicating a reduction in document structure generation cost by 4 to 20 times. For data-centric XML, the gain ratio was consistently around 5.12.
  • On-line Training: Showed that even a small fragment of the document could lead to saturation of match and gain ratios for data-centric XML. For document-centric XML, longer training was needed, but the adviser still provided significant benefits.

Limitations and Future Work

The authors acknowledge several limitations and suggest future directions:

  • Suggestion Index Limitations: The current suggestion index is primarily optimized for suggestions of depth 1 and for the "append" mode of document generation. Managing tree patterns of greater depth and non-empty prefixes/suffixes requires further development.
  • Dynamic Data Structures: The current index is static for off-line training. For on-line training, where suggestions are updated incrementally, more dynamic and incremental data structures are needed.
  • Beyond Elements: The current approach focuses on element structure. Future work could extend this to include element attributes, key dependencies, and other XML features.
  • User Interface and Integration: While the core mining and advising logic is presented, integrating this into a user-friendly graphical interface and exploring different scenarios for presenting suggestions to the user are important next steps. The authors mention a prototype integration with Adobe FrameMaker 6.0.

Summary updated

BibTeX
@inproceedings{chidlovskii2003structural,
  author = {Boris Chidlovskii},
  title = {{A structural adviser for the XML document authoring}},
  booktitle = {ACM Symposium on Document Engineering},
  year = {2003},
  doi = {10.1145/958220.958257},
}
Figure