Ben inline PHP ile bazı XHMTL oluşturmak için XSLT kullanmaya çalışıyorum. Ben inline PHP özniteliklerde üreten bir sorun üzerinden çalıştırmak.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="xml"
indent="yes"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
omit-xml-declaration="yes" />
<xsl:template match="/">
<html lang="<?php echo getLang(); ?>" xml:lang="<?php echo getLang(); ?>">
<head>
<xsl:processing-instruction name="php">include_title();</xsl:processing-instruction>
(Much more code ...)
aşağıdaki sonuçları verir:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:html="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php include_title();?>
(Much more code ...)
Html elemanın nitelikleri boş: "lang" ve "lang xml" olduğuna dikkat çekmek! Yani açıkça, bu satır içi PHP işlemek için yanlış bir yoldur.
Yani herkes istenilen sonuç aşağıda gösterilen almak için xsl kodunu değiştirmek için nasıl biliyor?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:html="http://www.w3.org/1999/xhtml" lang="<?php echo getLang(); ?>" xml:lang="<?php echo getLang(); ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php include_title();?>
(Much more code ...)
Teşekkürler, Kevin