Browse Prior Art Database

JSON *JavaScript Object Notation Template Language Transformations

IP.com Disclosure Number: IPCOM000189554D
Original Publication Date: 2009-Nov-12
Included in the Prior Art Database: 2009-Nov-12
Document File: 4 page(s) / 33K

Publishing Venue

IBM

Abstract

Disclosed is a system for JSON Template Language Transformations

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 46% of the total text.

Page 1 of 4

JSON *JavaScript Object Notation Template Language Transformations

There is no reusable, industry standard mechanism to format *JavaScript Object Notation (JSON) strings into HTML / XHTML (HyperText Markup Language/eXtensible HyperText Markup Language) suitable for display within a web browser. JSON strings retrieved by a JavaScript application from a server using Asynchronous JavaScript and XML (AJAX) calls must use customized code to transform the JSON response for display. Having a large amount of custom code, with little reuse among components,

produces application code that is error

Java Script Object Notation (JSON) Template Language (JTL) Transformations takes advantage of the structured nature of JSON data to produce reusable transformation templates. JTL is comprised of three components; the template, the compiler and the transformer. JTL is implemented completely in JavaScript and executed within a client's web browser making it independent of server-side technologies.

The Template

JTL templates are used to define the resulting format of transforming a JSON source string. The templates use a predefined set of function declarations to process JSON data. These function declarations are interpreted by the JTL Compiler into executable JavaScript code.

A JTL Template is implemented using a structured text file. The syntax of the template allows for the declaration of functions which are mapped to JavaScript functions definitions by the JTL Compiler. Each function declaration in the template has a set of supported parameters the compiler will analyze and incorporate into the compiled transform object. Function declarations in a JTL template as hierarchical. The root level of a JTL template is comprised of compiler instructions and template declarations. The JTL Template syntax supports the following root level declarations:

Declar ation

Param eters

match The template declaration is the root formatting element that all other formatting elements must be a child of. A JTL Template file must contain at least one or more template declarations.

uri Imports a JTL Template from the URI provided. If the imported template declarations match the match string of a template declaration in the originating JTL template, the originating JTL Template declaration is replaced.

uri Includes a JTL Template from the URI provided. If the included template declarations match the match string of a template declaration in the originating JTL template, the included JTL Template declaration is ignored.

class

Provides a mechanism to create user defined functions. The class

parameter represents the name of the JavaScript class containing

the function and the function parameter represents the name of the

prone and hard to maintain.

Comments

templat e

import

include

extend

functio n

1

Page 2 of 4

function itself.

Within a template declaration, additional functions can be declared to aid in the transformation of the JS...