Browse Prior Art Database

Generating Java Code from an XML schema with an XSL stylesheet

IP.com Disclosure Number: IPCOM000013848D
Original Publication Date: 2001-Jun-26
Included in the Prior Art Database: 2003-Jun-18
Document File: 2 page(s) / 55K

Publishing Venue

IBM

Abstract

Disclosed is a method for generating Java code from an XML database schema using an XSL stylesheet and a customized XSLT processor. Java inheritance is used to separate generated code from the custom

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 64% of the total text.

Page 1 of 2

Generating Java Code from an XML schema with an XSL stylesheet

    Disclosed is a method for generating Java code from an XML database schema using an XSL stylesheet and a customized XSLT processor. Java inheritance is used to separate generated code from the custom
added business code.

    Commercial code generators normally do not allow to modify the rules used to generate the code. This often leads to a significant overhead when the generated code has to be adapted to the current situation. This overhead is generated every time the code is regenerated, as the code generation rules cannot be modified. Also often the schema definition is stored in a proprietary format so that it cannot be used in another context.

    With the proposed method the schema definition is stored in an XML file and the code generation rules are defined in an XSL stylesheet. XSL stylesheets are normally used to transform data from one XML format to another XML format. Here we use the XSL to generate an XML file, that is later post-processed to separate Java source files.

    Both, XML and XSL are plain text files that can easily be edited, i.e. modified and extended. The XSL file contains powerful XML parsing constructs that can be utilized when defining the code generation
rules.

XML example

<bean>

<attrib name="Att1" type="int"/> <attrib name="Att2" type="String"/> </bean>

XSL example

<xsl:for-each select="bean/attrib"> public <xsl:value-of select="@type"/> get<xsl:value-of select="@name"/>(); </xsl:fo...