<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:key name="product-by-cat" match="product" use="@cat-ref"/>
<xsl:key name="product-by-id" match="product" use="@id"/>
<xsl:strip-space elements="*"/>
<xsl:output indent="yes"/>
<xsl:param name="product"/>
<xsl:param name="base-page" select="'../product.php'"/>
<xsl:template match="products">
<div id="productsdesc">
<xsl:if test="normalize-space($product)">
<xsl:apply-templates select="key('product-by-id', $product)/Description"/>
</xsl:if>
</div>
<div id="products">
<table>
<xsl:for-each select="categories/category[position() mod 3 = 1]">
<tr>
<th><xsl:apply-templates select="."/></th>
<th><xsl:apply-templates select="following-sibling::category[1]"/></th>
<th><xsl:apply-templates select="following-sibling::category[2]"/></th>
</tr>
<xsl:call-template name="get-next-row">
<xsl:with-param name="cat1" select="@cat-id"/>
<xsl:with-param name="cat2" select="following-sibling::category[1]/@cat-id"/>
<xsl:with-param name="cat3" select="following-sibling::category[2]/@cat-id"/>
<xsl:with-param name="count" select="1"/>
</xsl:call-template>
</xsl:for-each>
</table>
</div>
</xsl:template>
<xsl:template name="get-next-row">
<xsl:param name="cat1"/>
<xsl:param name="cat2"/>
<xsl:param name="cat3"/>
<xsl:param name="count"/>
<xsl:if test="key('product-by-cat', $cat1)[position() = $count ]| key('product-by-cat', $cat2)[position() = $count] | key('product-by-cat', $cat3)[position() = $count]">
<tr>
<td><a href="{concat($base-page, '?product=', key('product-by-cat', $cat1)[position() = $count ]/@id)}"><xsl:apply-templates select="key('product-by-cat', $cat1)[position() = $count ]/title"/></a></td>
<td><a href="{concat($base-page, '?product=', key('product-by-cat', $cat2)[position() = $count ]/@id)}"><xsl:apply-templates select="key('product-by-cat', $cat2)[position() = $count ]/title"/></a></td>
<td><a href="{concat($base-page, '?product=', key('product-by-cat', $cat3)[position() = $count ]/@id)}"><xsl:apply-templates select="key('product-by-cat', $cat3)[position() = $count ]/title"/></a></td>
</tr>
<xsl:call-template name="get-next-row">
<xsl:with-param name="cat1" select="$cat1"/>
<xsl:with-param name="cat2" select="$cat2"/>
<xsl:with-param name="cat3" select="$cat3"/>
<xsl:with-param name="count" select="$count + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="p">
<p>
<xsl:apply-templates select="node()"/>
</p>
<br/>
</xsl:template>
<xsl:template match="list">
<p class="list_intro">
<xsl:apply-templates select="list-intro"/>
</p>
<br/>
<ol>
<xsl:for-each select="list-item">
<li><xsl:apply-templates/></li>
</xsl:for-each>
</ol>
</xsl:template>
</xsl:stylesheet>
products.xml<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Products - Australian Financial and Mortgage Services </title>
<meta http-equiv="content-script-type" content="text/javascript" >
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" >
<link href="settings.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container"><!-- Top of the page and page location -->
<div id= "ptitle"><b>PRODUCTS AND SERVICES</b></div>
<?php include("menu.php"); ?>
<?php
$xsl = new DomDocument;
$xsl->load('products.xsl');
$xp->importStylesheet($xsl);
$xml_doc = new DomDocument;
$xml_doc->load('products.xml');
echo $xp->transformToXML($xml_doc);
?>
<!-- *****This is for the bottom table links****-->
<?php include("footer.php"); ?>
<!--**** This is for the bottom table links***-->
<!-- Bottom of the page and page location -->
</div>
</body>
</html>
<?php
$xml_doc = new DomDocument;
$xml_doc->load('products.xml');
$xpath = new DOMXpath($xml_doc);
$elements = $xpath->query("//product/title");
if (!is_null($elements)) {
foreach ($elements as $element) {
echo "<br/>[". $element->nodeValue . "]";
}
}
//echo $xml_doc;
?>
[Standard Variable]
[Basic Variable]
[Introductory (Honeymoon)]
[Fixed Rate Loan]
[Refinancing]
[Bridging Loan]
[Credit Impaired]
[Low Document Loans]
[Second Mortgages]
[Hire Purchase]
[Finance Lease]
[Commercial Mortgages]
[Short Term Business Loans]
[Medium-Long Term Business Loans]
[Why is an Investment Property a Good Strategy ?]
[Negative Gearing]
[Capital Gains Tax]
[Line of Credit]
[Reverse Mortgages]
<?php
echo "Hello World"
?>
<?php
//echo "[" . $_GET["product"] . "]<br/>" ;
$xsl = new DomDocument;
$xsl->load('products.xsl');
$xp = new xsltprocessor;
$xp->importStylesheet($xsl);
$xml_doc = new DomDocument;
$xml_doc->load('products.xml');
$xpath = new DOMXpath($xsl);
$attributes = $xpath->query("/*/@version");
if (!is_null($attributes)) {
foreach ($attributes as $attribute) {
echo "<br/>[". $attribute->nodeValue . "]";
}
}
?>
<?php
//echo "[" . $_GET["product"] . "]<br/>" ;
$xsl = new DomDocument;
$xsl->load('products.xsl');
$xp = new xsltprocessor;
$xp->importStylesheet($xsl);
$xml = new DomDocument;
$xml->load('products.xml');
echo $xp->transformToXml($xml);
?>
<?php
echo "[" . $_GET["product"] . "]<br/>" ;
$xsl = new DomDocument;
$xsl->load('products.xsl');
$xp = new xsltprocessor;
$xp->importStylesheet($xsl);
$xml = new DomDocument;
$xml->load('products.xml');
echo $xp->transformToXml($xml);
?>
<html>
<head>
<title>Products - Australian Financial and Mortgage Services </title>
</head>
<body>
<?php
$xsl = new DomDocument;
$xsl->load('..\products.xsl');
$xp->importStylesheet($xsl);
$xml_doc = new DomDocument;
$xml_doc->load('..\products.xml');
echo $xp->transformToXML($xml_doc);
?>
</body>
</html>
<html>
<body>
<p>
<?php
//echo "[" . $_GET["product"] . "]<br/>" ;
$xsl = new DomDocument;
$xsl->load('products.xsl');
$xp = new xsltprocessor;
$xp->importStylesheet($xsl);
$xml = new DomDocument;
$xml->load('products.xml');
echo $xp->transformToXml($xml);
// $xpath = new DOMXpath($xsl);
// $attributes = $xpath->query("/*/@version");
// if (!is_null($attributes)) {
// foreach ($attributes as $attribute) {
// echo "<br/>[". $attribute->nodeValue . "]";
// }
// }
?>
</p>
</body>
</html>
echo "[" . $_GET["product"] . "]<br/>" ;
<html>
<body>
<p>
<?php
//echo "[" . $_GET["product"] . "]<br/>" ;
$xsl = new DomDocument;
$xsl->load('http://60.241.48.12/ausf/products.xsl');
$xp = new xsltprocessor;
$xp->importStylesheet($xsl);
$xml = new DomDocument;
$xml->load('products.xml');
$xpath = new DOMXpath($xsl);
$attributes = $xpath->query("/*/@version");
if (!is_null($attributes)) {
foreach ($attributes as $attribute) {
echo "<br/>[". $attribute->nodeValue . "]";
}
}
?>
</p>
</body>
</html>
<html>
<body>
<p>
<?php
//echo "[" . $_GET["product"] . "]<br/>" ;
$xsl = new DomDocument;
$xsl->load('http://60.241.48.12/ausf/products.xsl');
$xp = new xsltprocessor;
$xp->importStylesheet($xsl);
$xml = new DomDocument;
$xml->load('http://60.241.48.12/ausf/products.xml');
echo $xp->transformToXml($xml);
?>
</p>
</body>
</html>