IBM®
Skip to main content
    United States change      Terms of use
 
 
Select a scope:    
     Home      Products      Services & industry solutions      Support & downloads      My account     
alphaWorks  >  XML  >  

Hierarchical Inherited Rule-Interpreted XML

A dynamic XML Engine that creates dynamic DOMs built on dynamic rules and expressions.


Date Posted: July 25, 2006
OverviewRequirements Download FAQs Forum Reviews

What is Hierarchical Inherited Rule-Interpreted XML?

Hierarchical Inherited Rule-Interpreted XML is much like an XML parser in that it takes any XML source and parses the XML to create a document object model (DOM), which can then be accessed via an API. However, the capabilities of Hierarchical Inherited Rule-Interpreted XML extend far beyond the realm of simply parsing XML. This technology is capable of modifying the XML structure as the DOM is created as well as dynamically interpreting values from the DOM as it is accessed via the API during run-time execution. Therefore, expressions can now be embedded within the elements and attributes of a XML document, and, when the element or attribute value is retrieved via the API, it is interpreted by execution of the expression.

For example, imagine an XML document that contains an attribute called "username". The value of that attribute can then be defined as an expression so that whenever a query for the attribute value surfaces during the execution of this application, it is resolved based on the current application state, thus ensuring that the value will always be the current user. Hierarchical Inherited Rule-Interpreted XML makes possible a living XML document in which any value can be dynamically resolved during execution of an application.

Hierarchical Inherited Rule-Interpreted XML is a dynamic engine that also allows one to modify the XML document structure after it is parsed. Structure modifications are then represented in the created DOM. The DOM also can present modifications dynamically, so that the elements that exist within the DOM may be determined based on application state. Therefore, the API can be queried in order to collect a list of child elements from an element in an XML document, but the list of elements returned may not represent the physical XML document that was originally parsed.

Imagine a case in which an XML document is queried for a list of link elements that should be displayed on a Web page. Hierarchical Inherited Rule-Interpreted XML could make a decision, based on current application state (possibly the current user), that only certain link elements are applicable. Therefore, when one asks the API for a list of elements, they can be determined based on the current application state. This determination would then allow the application to simply ask for the list of links, and the returned list will be applicable only for the current user.

Many flexible options are available for XML document modification. Dynamic modification allows the XML document to transform itself to be always specifically applicable to the current application state. Portions of the XML Document can be reused through methods such as inheritance, injection, and import. This dynamic modification allows for concise XML documents as well as high levels of reuse across XML documents.

Hierarchical Inherited Rule-Interpreted XML creates a living XML document for an application to access. Both the content and structure of the document are always derived at run time and are based on the current state of the application. The use of dynamic XML for application configuration, definitions, and behaviors opens up new concepts of application development oriented around flexible and adaptive applications.

Applications included in Hierarchical Inherited Rule-Interpreted XML are as follows:

  • Dynamic Java™ Properties: This technology can replace the standard Java properties with a dynamic version in which property values are derived from rules and application state.
  • Application Configuration: This technology allows extension of typical XML configuration to dynamism such that XML configuration files can adapt to environment or application state.
  • Rule Engines: This technology provides a platform for easy construction of application components in which the run-time behavior is controlled by externalized dynamic rules.
  • Dynamic XML DOM: The core function of this technology is to provide a dynamic, run time-interpreted DOM. This technology is useful to nearly all applications that use XML or that one wishes to be more dynamic in configuration or run-time behavior. Capabilities include everything from multiple inheritance within XML to custom, pluggable expression language interpreters.

Applications built with Hierarchical Inherited Rule-Interpreted XML are more dynamic and flexible and do not require code changes for changes to application behavior or function. This technology makes it possible to develop applications with zero turn-around time, allowing for immediate feedback without having to wait for lengthy building, compiling, or server restarting cycles.

How does it work?

Hierarchical Inherited Rule-Interpreted XML works by parsing an XML document and creating a highly-specialized DOM, which is constructed to be optimized for applying dynamic rules to the DOM during run-time access to the DOM. This optimization comes in two forms: dynamic value interpretation of expressions in the XML and structural modifications to the XML document.

Dynamic value interpretation is achieved through pluggable expression interpreters, which are executed when the API is accessed in order to retrieve the value of an element or attribute. The default interpreter is JEXL; however, other interpreters exist for Groovy, FreeMarker, and Velocity. This dynamic value interpretation enables embedding of any of these expressions or script languages within the XML document. Indeed, custom interpreters may also be easily added.

Structural modifications to the XML document are the result of inheritance, injection, importing, or application of conditions that might make elements invisible to the DOM API. The manner in which the XML document structure is modified is configurable. Rules can be defined that determine how inheritance or injection is applied. Importation can pull together multiple XML documents and has the ability to apply XPath to select only portions of documents to assemble into a single document. Conditions are expressions that can be added to an element and that determine the visibility of the element to the DOM API. This flexibility in visibility allows structural modifications to the XML document to be dynamically applied so that portions of the document that might not be applicable within the current application state are simply not visible to the API.

The performance of the Hierarchical Inherited Rule-Interpreted XML DOM has been optimized for run-time applications. It is designed so that one is able to actively access the DOM within one's application without penalty.


About the technology author(s):
Chad Meadows is the IBM Global Account's Lead Reuse Engineer. He is deeply involved with systematic reuse strategies and reusable assets throughout the company. He has been working at IBM in IT since 1993. Mr. Meadows is also an IBM Innovation Catalyst who assists in the development and adoption of innovative ideas and technologies for the company.

View screenshots:
Simple XML file with dynamic expression  shows Java code.

Download now Download now

Related technologies

For platform(s):
Java

For topics:
APIs, configuration, Java technology, Parsers, XML, XPath


Related resources

Delve into Hierarchical Inherited Rule-Interpreted XML

 

    About IBM Privacy Contact