# Class: XML::XSLT
[ "README", "AUTHORS", "ChangeLog", "xslt.c", nil].each do
XML.view_html
XML::XSLT.view_html
XML::XSLT::TransformationError.view_html
XML::XSLT::ParsingError.view_html
XML::XSLT::XSLTError.view_html
end

Class XML::XSLT < Object

(in files xslt.c )

Methods

Public Class method: define_ext_function(p1, p2, p3)

XML::XSLT::extFunction( "round-trip", "test.none", rbObj ) registers an extension function "round-trip" in the namespace "test.none"

when XPath like ex:round-trip(arg) is encountered in the XSLT it will call the method "round_trip" on the rbObj object with the argument arg

/**
 * XML::XSLT::extFunction( "round-trip", "http://test.none", rbObj )
 * registers an extension function "round-trip" in the namespace "http://test.none"
 *
 * when XPath like ex:round-trip(arg) is encountered in the XSLT it will call the method "round_trip" on the rbObj object with the argument arg
 */
 VALUE ruby_xslt_define_ext_function( VALUE class, VALUE name, VALUE ns_uri, VALUE method ) {

Public Class method: errors()

error_ary = XML::XSLT::errors( )

Return an Array containing all the xml errors

This method is only available if Ruby/XSLT has been configured with —enable-error-handler option

/**
 * error_ary = XML::XSLT::errors( )
 *
 * Return an Array containing all the xml errors
 *
 * This method is only available if Ruby/XSLT has been configured with --enable-error-handler option
 */
VALUE rb_xslt_errors(VALUE class) {

Public Class method: new()

oXSLT = XML::XSLT::new()

Create a new XML::XSLT object

/** 
 * oXSLT = XML::XSLT::new()
 * 
 * Create a new XML::XSLT object
 */
VALUE ruby_xslt_new( VALUE class ) {

Public Instance method: mediaType()

mediaTypeString = oXSLT.mediaType( )

Return the XSL output’s media type

/**
 * mediaTypeString = oXSLT.mediaType( )
 *
 * Return the XSL output's media type
 */
VALUE ruby_xslt_media_type( VALUE self ) {

Public Instance method: parameters=(p1)

oXSLT.parameters={ "key" => "value", "key" => "value", … }

/**
 * oXSLT.parameters={ "key" => "value", "key" => "value", ... } 
 */
VALUE ruby_xslt_parameters_set( VALUE self, VALUE parameters ) {

Public Instance method: save(p1)

oXSLT.save( "result.xml" )

Save the stylesheet transformation to file

/** 
 * oXSLT.save( "result.xml" ) 
 *
 * Save the stylesheet transformation to file
 */
VALUE ruby_xslt_save( VALUE self, VALUE xOutFilename ) {

Public Instance method: serve()

output_string = oXSLT.serve( )

Return the stylesheet transformation

/** 
 * output_string = oXSLT.serve( )
 *
 * Return the stylesheet transformation 
 */
VALUE ruby_xslt_serve( VALUE self ) {

Public Instance method: xml()

string = oXSLT.xml

Return XML, set by XML::XSLT#xml=, as string

/**
 * string = oXSLT.xml
 *
 * Return XML, set by XML::XSLT#xml=, as string
 */
VALUE ruby_xslt_xml_2str_get( VALUE self ) {

Public Instance method: xml=(p1)

oXSLT.xml=<data|REXML::Document|XML::Smart|file>

Set XML data.

Parameter can be type String, REXML::Document, XML::Smart::Dom or Filename

Examples :

 # Parameter as String
 oXSLT.xml = <<XML
 <?xml version="1.0" encoding="UTF-8"?>
 <test>This is a test string</test>
 XML

 # Parameter as REXML::Document
 require 'rexml/document'
 oXSLT.xml = REXML::Document.new File.open( "test.xml" )

 # Parameter as XML::Smart::Dom
 require 'xml/smart'
 oXSLT.xml = XML::Smart.open( "test.xml" )

 # Parameter as Filename
 oXSLT.xml = "test.xml"
/**
 * oXSLT.xml=<data|REXML::Document|XML::Smart|file>
 *
 * Set XML data.
 *
 * Parameter can be type String, REXML::Document, XML::Smart::Dom or Filename
 * 
 * Examples :
 *  # Parameter as String
 *  oXSLT.xml = <<XML
 *  <?xml version="1.0" encoding="UTF-8"?> 
 *  <test>This is a test string</test>
 *  XML
 *
 *  # Parameter as REXML::Document
 *  require 'rexml/document'
 *  oXSLT.xml = REXML::Document.new File.open( "test.xml" )
 *
 *  # Parameter as XML::Smart::Dom
 *  require 'xml/smart'
 *  oXSLT.xml = XML::Smart.open( "test.xml" )
 *
 *  # Parameter as Filename
 *  oXSLT.xml = "test.xml"
 */
VALUE ruby_xslt_xml_obj_set( VALUE self, VALUE xml_doc_obj ) {

Public Instance method: xmlfile=(p1)

XML::XSLT#xmlfile=<file> is deprecated. Please use XML::XSLT#xml=<file>

/**
 * XML::XSLT#xmlfile=<file> is deprecated. Please use XML::XSLT#xml=<file>
 */
VALUE ruby_xslt_xml_obj_set_d( VALUE self, VALUE xml_doc_obj ) {

Public Instance method: xmlobject()

object = oXSLT.xmlobject

Return the XML object set by XML::XSLT#xml=

/**
 * object = oXSLT.xmlobject
 *
 * Return the XML object set by XML::XSLT#xml=
 */
VALUE ruby_xslt_xml_2obj_get( VALUE self ) {

Public Instance method: xsl()

string = oXSLT.xsl

Return XSL, set by XML::XSLT#xsl=, as string

/**
 * string = oXSLT.xsl
 *
 * Return XSL, set by XML::XSLT#xsl=, as string
 */
VALUE ruby_xslt_xsl_2str_get( VALUE self ) {

Public Instance method: xsl=(p1)

oXSLT.xsl=<data|REXML::Document|XML::Smart|file>

Set XSL data.

Parameter can be type String, REXML::Document, XML::Smart::Dom or Filename

Examples :

 # Parameter as String
 oXSLT.xsl = <<XML
 <?xml version="1.0" ?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>
 </xsl:stylesheet>
 XML

 # Parameter as REXML::Document
 require 'rexml/document'
 oXSLT.xsl = REXML::Document.new File.open( "test.xsl" )

 # Parameter as XML::Smart::Dom
 require 'xml/smart'
 oXSLT.xsl = XML::Smart.open( "test.xsl" )

 # Parameter as Filename
 oXSLT.xsl = "test.xsl"
/**
 * oXSLT.xsl=<data|REXML::Document|XML::Smart|file>
 *
 * Set XSL data.
 *
 * Parameter can be type String, REXML::Document, XML::Smart::Dom or Filename
 * 
 * Examples :
 *  # Parameter as String
 *  oXSLT.xsl = <<XML
 *  <?xml version="1.0" ?>
 *  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 *   <xsl:template match="/">
 *     <xsl:apply-templates />
 *   </xsl:template>
 *  </xsl:stylesheet>
 *  XML
 *
 *  # Parameter as REXML::Document
 *  require 'rexml/document'
 *  oXSLT.xsl = REXML::Document.new File.open( "test.xsl" )
 *
 *  # Parameter as XML::Smart::Dom
 *  require 'xml/smart'
 *  oXSLT.xsl = XML::Smart.open( "test.xsl" )
 *
 *  # Parameter as Filename
 *  oXSLT.xsl = "test.xsl"
 */
VALUE ruby_xslt_xsl_obj_set( VALUE self, VALUE xsl_doc_obj ) {

Public Instance method: xsl_to_s()

string = oXSLT.xsl_to_s( )

/** 
 * string = oXSLT.xsl_to_s( ) 
 */
VALUE ruby_xslt_to_s( VALUE self ) {

Public Instance method: xslfile=(p1)

XML::XSLT#xslfile=<file> is deprecated. Please use XML::XSLT#xsl=<file>

/**
 * XML::XSLT#xslfile=<file> is deprecated. Please use XML::XSLT#xsl=<file>
 */
VALUE ruby_xslt_xsl_obj_set_d( VALUE self, VALUE xsl_doc_obj ) {

Public Instance method: xslobject()

object = oXSLT.xslobject

Return the XSL object set by XML::XSLT#xsl=

/**
 * object = oXSLT.xslobject
 *
 * Return the XSL object set by XML::XSLT#xsl=
 */
VALUE ruby_xslt_xsl_2obj_get( VALUE self ) {