<?xml-stylesheet type="text/xml" href="#xstyle"?>
по-видимому нужно написать<?xml-stylesheet type="text/xml" href="#xsl:xstyle"?>
<?php
$xmlstr=<<<XML
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE doc [
<!ELEMENT doc (component)>
<!ELEMENT component (software, title)>
<!ELEMENT software (#PCDATA)>
<!ELEMENT title (#PCDATA)>
]>
<doc>
<component>
<software>Абвгд</software>
<title>йцукенгшщзх</title>
</component>
</doc>
XML;
$xslstr=<<<XSL
<?xml version="1.0" encoding="Windows-1251"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" encoding="Windows-1251"
omit-xml-declaration="yes"
standalone="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="yes"
media-type="text-html" />
<xsl:template match="/doc/component">
<html><head><title>Ёклмн</title></head><body>
<h1 title="опрст {title}"><xsl:value-of select="software"/></h1>
</body></html>
</xsl:template>
<xsl:template match="xsl:stylesheet"/>
</xsl:stylesheet>
XSL;
dl("php_xsl.dll");
$xml = new DOMDocument;
$xml->loadXML($xmlstr); //$xml->load('1.xml');// Load the XML source
if (!$xml->validate()) die("This document is invalid!");
$xsl = new DOMDocument;
$xsl->loadXML($xslstr);//$xsl->load('1.xsl');
$proc = new XSLTProcessor;// Configure the transformer
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml);
//$proc->transformToURI($xml, 'file:///tmp/out.html');
выдает:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1251" />
<title>Ёклмн</title>
</head>
<body>
<h1 title="опрст йцукенгшщзх">Абвгд</h1>
</body>
</html>
Скопируйте, если не жалко, сюда Ваш исходник.<?php
$xmlstr=<<<XML
<?xml version="1.0" encoding="windows-1251"?>
<!DOCTYPE doc [
<!ELEMENT doc (component)>
<!ELEMENT component (software)>
<!ELEMENT software (#PCDATA)>
]>
<doc>
<component>
<software>Абвгд</software>
</component>
</doc>
XML;
$xslstr=<<<XSL
<?xml version="1.0" encoding="Windows-1251"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" encoding="Windows-1251"
omit-xml-declaration="yes"
standalone="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="yes"
media-type="text-html" />
<xsl:template match="/doc/component/software">
<html><head><title>Ёклмн</title></head><body>
<h1><xsl:apply-templates/></h1>
</body></html>
</xsl:template>
<xsl:template match="xsl:stylesheet"/>
</xsl:stylesheet>
XSL;
dl("php_xsl.dll");
$xml = new DOMDocument;
$xml->loadXML($xmlstr); //$xml->load('1.xml');// Load the XML source
if (!$xml->validate()) die("This document is invalid!");
$xsl = new DOMDocument;
$xsl->loadXML($xslstr);//$xsl->load('1.xsl');
$proc = new XSLTProcessor;// Configure the transformer
$proc->importStyleSheet($xsl); // attach the xsl rules
echo $proc->transformToXML($xml);
//$proc->transformToURI($xml, 'file:///tmp/out.html');
Выдает:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=Windows-1251" />
<title>Ёклмн</title>
</head>
<body>
<h1>Абвгд</h1>
</body>
</html>
Правда у меня винда Чулан
индекс 0,00 Посты | Q&A | События
Захабренные | Новые | Отхабренные
Нет никаких QA, смирись!