Login   Register  
PHP Classes
elePHPant
Icontem

File: rdfapi/test/serializeroptions.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Chris Bizer  >  RDF API  >  rdfapi/test/serializeroptions.php  >  Download  
File: rdfapi/test/serializeroptions.php
Role: Example script
Content type: text/plain
Description: Test Serializer Options
Class: RDF API
Package for manipulating RDF models.
Author: By
Last change:
Date: 2002-10-04 09:34
Size: 1,428 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Test Serializer Options</title>
</head>
<body>

<?php
define
("RDFAPI_INCLUDE_DIR""./../api/");
include(
RDFAPI_INCLUDE_DIR "RDFAPI.php");

// This is the URI of the document to be dumped
$base="C:/OpenSA/Apache/htdocs/rdf_api/test/example2.rdf";

// Create new Parser 
$parser = new RdfParser();

// Parse document
$model =& $parser->generateModel($base);

// Output as Table
RDFUtil::writeHTMLTable($model);
echo 
"<P>";

              
// Create Serializer and serialize model to RDF with default configuration
$ser = new RDFSerializer();
$rdf =& $ser->serialize($model);
echo 
"<p><textarea cols='110' rows='20'>" $rdf "</textarea>";

// Serialize model to RDF using attributes
$ser->configUseAttributes(TRUE);
$rdf =& $ser->serialize($model);
echo 
"<p><textarea cols='110' rows='20'>" $rdf "</textarea>";
$ser->configUseAttributes(FALSE);
 
// Serialize model to RDF using entities
$ser->configUseEntities(TRUE);
$rdf =& $ser->serialize($model);
echo 
"<p><textarea cols='110' rows='30'>" $rdf "</textarea>";
$ser->configUseEntities(FALSE);

// Serialize model to RDF without qnames for RDF tags
$ser->configUseQnames(FALSE);
$rdf =& $ser->serialize($model);
echo 
"<p><textarea cols='110' rows='20'>" $rdf "</textarea>";
$ser->configUseQnames(TRUE);

 


?>



</body>
</html>