PHP <脚本语言=“php">标签 [英] PHP <script language="php"> tags
问题描述
在使用替代 PHP 标签时是否有任何需要注意的注意事项:
Are there any caveats one should be aware of when using the alternative PHP tags:
<script language="php">
// ...
</script>
我已经在 5.2.X 到 5.4.X 中进行了测试,没有出现任何问题,但是我找不到有关该主题的详尽信息.我最担心的是突然弃用.任何有关支持此替代方案的信息都会很棒.
I've tested in 5.2.X through 5.4.X with no issues, however I cannot find exhaustive information on the topic. My greatest concern is sudden deprecation. Any information about support for this alternative would be great.
为了回答你到底为什么要使用它?",我在 XML 文件中使用 PHP,其中周围的 XML 充当包含脚本的元数据其中.不幸的是,XSD 不能验证处理指令节点,呃,使用元素标签来包装 PHP 会简化验证过程.这将保持语义价值.
To answer those asking "Why the heck do you want to use that anyways?", I'm using PHP in XML files, where the surrounding XML acts as meta-data to the script contained therein. Unfortunately, XSD cannot validate processing instruction nodes, er go, using an element tag to wrap the PHP would simplify the validation process. This would keep the semantic value.
目前我需要针对 XSD 进行验证,并使用 XPath 执行验证后扫描以检查处理指令节点.
As it stands I need to validate against the XSD, and perform a post-validation sweep using XPath to check for processing instruction nodes.
推荐答案
根据 PHP 文档:
虽然在例子中看到的标签之一 [ <?php ?>]
和两个 [