Exemplo n.º 1
0
 function getArticles()
 {
     $xml = $this->getXML();
     $XML_XSL = new XSL_XML();
     $content = $XML_XSL->xml_xsl($xml, dirname(__FILE__) . "/../../xsl/similarToArray.xsl");
     $content = str_replace('<?xml version="1.0" encoding="ISO-8859-1"?>', '', $content);
     $articles = split('\\|SIMILAR_SPLIT\\|', $content);
     $article = new Article();
     for ($i = 0; $i < count($articles) - 1; $i++) {
         $articles[$i] = split('\\|ITEM_SPLIT\\|', $articles[$i]);
         if (trim($articles[$i][0]) != '') {
             $article->setPID(trim($articles[$i][0]));
             $article->setPublicationDate(trim($articles[$i][1]));
             $article->setRelevance(trim($articles[$i][2]));
             $article->setURL(trim($articles[$i][3]));
             $article->setTitle(trim($articles[$i][4]));
             $article->setSerial(trim($articles[$i][5]));
             $article->setVolume(trim($articles[$i][6]));
             $article->setNumber(trim($articles[$i][7]));
             $article->setYear(trim($articles[$i][8]));
             $article->setSuppl(trim($articles[$i][9]));
             $article->setAuthorXML(str_replace("\n", "", trim($articles[$i][10])));
             $article->setKeywordXML(trim($articles[$i][11]));
             $arrArticles[$i] = $article;
         }
     }
     //	die(print_r($arrArticles));
     return $arrArticles;
 }
Exemplo n.º 2
0
					$xml .= "</vars>";
					if (strpos(strtolower($xmlh), 'utf-8')){
						$xmlh = utf8_decode($xmlh);
						$xmlh = str_replace('<?xml version="1.0" encoding="utf-8"?>','',$xmlh);
						$xmlh = str_replace('<?xml version="1.0" encoding="UTF-8"?>','',$xmlh);
					}
					$xml .= str_replace('<?xml version="1.0" encoding="ISO-8859-1"?>','',$xmlh);
					$xml .= "</root>";
					print("<!-- BEGIN MIDDLE -->");
					
					if(isset($_GET["debug"]))
					{
						echo '<textarea cols="80" rows="20" >';
					}
		
					print(utf8_decode($transformer->xml_xsl($xml,$xslFile,$_GET["debug"])));

					if(isset($_GET["debug"]))
					{
						echo '</textarea>';
					}
					
					print("<!-- END MIDDLE -->");
				}
				else
				{
					echo "Could not open XML file ".$xmlFile;
				}
			?>			
			<!--End of middle content for second level pages -->
			</div>
Exemplo n.º 3
0
<?php

include "class.XSLTransformer.php";
include "XML.php";
//	phpinfo();
$XML_XSL = new XSL_XML();
$xml = $XML_XSL->returnContent($argv[1]);
$xsl = $argv[2];
$xml = $XML_XSL->xml_xsl($xml, $xsl, "");
$fp = fopen($argv[3], "w");
if ($fp) {
    fwrite($fp, $xml);
}