Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,110 of 9,110 pages
About the help in other languages
All help pages

Adding XSLT and DTD definitions to XML output

The eZXML library can deliver XSLT and DTD definitions when building a XML document. Several applications read various XML documents. They try to determine the type of the documents by reading the DTD. Further more they…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/features/3.8/XSLT_and_DTD_definitions.txt

*Title: Adding XSLT and DTD definitions to XML output

*Description:

The eZXML library can deliver XSLT and DTD definitions when building a XML document.
Several applications read various XML documents. They try to determine the type of the documents
by reading the DTD. Further more they use the XSLT definitions to render the information stored 
in the XML document.  

*Documentation:

2 new functions where added to eZDOMNode.

Function: 
setDocTypeDefinition( $url = false, $alias = false, $explict = false )

Parameters:
$url A vaild URL 
$alias An alias representing the document, for example "-//My Company//DTD XMLEXPORT V 1.0//EN"
$explict Declare if DTD must be used.

Function: 
function setStylesheet( $url )

Parameters:
$url A vaild URL or array of URLs

Example:
The following script will output the xml document below.

<?php
include_once( 'lib/ezxml/classes/ezxml.php' );
$rootname = 'TEST';       
$doc = new eZDOMDocument();
$base = 'http://www.example.com';
$doc->setStylesheet( $base . '/test.xslt' );
$doc->setDocTypeDefinition( $base . '/test.dtd', "-//xrow GbR//DTD ". $rootname . " V 1.0//EN" );
$root =& $doc->createElementNode( $rootname );
$doc->setRoot( $root );
echo $doc->toString();
exit();
?>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE TEST PUBLIC "-//xrow GbR//DTD TEST V 1.0//EN" "http://www.example.com/test.dtd">
<?xml-stylesheet type="text/xsl" href="http://www.example.com/test.xslt"?>
<TEST />

Something wrong on this page? Report an error

Documentation license

This page was inherited from the documentation of the original software. It is not covered by the GNU Free Documentation License; it is distributed under the GNU General Public License, version 2.

Copyright (C) 1999 - 2014 eZ Systems AS and contributors