XML
  Home arrow XML arrow Page 8 - Using Script Extensions in Xalan-Java
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Using Script Extensions in Xalan-Java
By: Seamus Donohue
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2004-06-16

    Table of Contents:
  • Using Script Extensions in Xalan-Java
  • Xalan-Java Scripting Extensions, Resources, Requirements
  • The Scripting Scenario
  • Plugging the Scripts into the XSLT Stylesheet
  • Python
  • VBScript
  • PerlScript
  • Running the Stylesheet

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using Script Extensions in Xalan-Java - Running the Stylesheet


    (Page 8 of 8 )

    The complete stylesheet is available here. The stylesheet contains all four script language implementations and is configured to run the JavaScript functions. To select a different script implementation, set the appropriate variable to 1 in the stylesheet section shown below, and reset all the other use-script variables to 0. The variable settings below will use VBScript function implementations.

    <!-- SWITCH ON/OFF SCRIPT LANGUAGES HERE -->
    <xsl:variable name="use-javascript" select="0"/>
    <xsl:variable name="use-jpython" select="0"/>
    <xsl:variable name="use-vbscript" select="1"/>
    <xsl:variable name="use-perlscript" select="0"/>

    Ant Configuration

    The samples are run using the build.xml Ant script. This script uses properties specified in the build.properties file. Ensure that the properties in this file are set correctly for your environment.

    #product homes
    xalan.home =d:/apps/xalan-j_2_6_0
    js.home  =d:/apps/rhino1_5R4
    jython.home =d:/apps/jython-2.1

    When the properties are correctly set, run the XSLT execute:

    ant run

    The run target will patch the BSF JAR file if required, build the Java Lookup class used in the scripts as necessary, and then call the Xalan command line tool, which transforms the input file ./xml/ sample_in.xml into ./xml/out.xml using the XSLT file ./xml/ sample_rules.xslt.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    XML ARTICLES

    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway