XSLTProcessor::importStylesheet() 中的多个 PHP 警告

2024-04-17

Errors:



Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: 
Undefined variable in /transform.php on line 24

Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: 
compilation error: file /protocols.xsl line 18 element template in /transform.php on line 24

Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: 
Failed to compile predicate in /transform.php on line 24

Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: 
Undefined variable in /transform.php on line 24

Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: 
compilation error: file /home6/oneninfi/public_html/craigfreeman/iphone/project1/protocols.xsl line 22 element template in /transform.php on line 24

Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: 
Failed to compile predicate in /transform.php on line 24

Warning: XSLTProcessor::transformToXml() [xsltprocessor.transformtoxml]: 
No stylesheet associated to this object in /transform.php on line 35
  

PHP:

$xsl = new XSLTProcessor();
    $xsldoc = new DOMDocument();
    $xsldoc->load($_GET['xsl'].'.xsl'); // protocols.xsl
    $xsl->importStyleSheet($xsldoc); // LINE 24

    if(isset($_GET['sectionNumber']))
        $xsl->setParameter('', 'sectionNumber', $_GET['sectionNumber']);
    if(isset($_GET['protocolNumber']))
        $xsl->setParameter('', 'protocolNumber', $_GET['protocolNumber']);
    if(isset($_GET['entryNumber']))
        $xsl->setParameter('', 'entryNumber', $_GET['entryNumber']);

    $xmldoc = new DOMDocument();
    $xmldoc->load($_GET['xml'].'.xml');
    echo $xsl->transformToXML($xmldoc); // LINE 35

XSL:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="protocolNumber"></xsl:param>
    <xsl:param name="sectionNumber"></xsl:param>
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="page/section[@id=$sectionNumber]"> // LINE 18
    <xsl:apply-templates select="protocol[@id=$protocolNumber]"/>
</xsl:template>

<xsl:template match="protocol[@id=$protocolNumber]"> // LINE 22
  <h4>(<xsl:value-of select="$sectionNumber"/>.<xsl:value-of select="@id"/>)&nbsp;<xsl:value-of select="@title"/></h4>
    <!-- Applies templates to all child elements -->
    <ol><xsl:apply-templates/></ol>
</xsl:template>

<xsl:template match="start">
  <span class="start"><xsl:value-of select="@level" /></span>
</xsl:template>

<xsl:template match="stop">
  <span class="stop"><xsl:value-of select="@level" />&nbsp;STOP</span>
</xsl:template>

<xsl:template match="note">
  <span class="note"><span class="noteType"><xsl:value-of select="@title" /></span>:&nbsp;<xsl:value-of select="." /></span>
</xsl:template>

<xsl:template match="step">
   <li><span class="step"><xsl:value-of select="."/></span></li>
</xsl:template>

</xsl:stylesheet>

XML:

<?xml version="1.0" encoding="UTF-8"?>
<page type="Protocols">
    <section id="3" title="Adult Cardiac Life Support">
        <protocol id="0" title="Cardiac Arrest - General Procedures">
            <start level="All Levels"/>
                <step>Verify patient is pulseless and apneic.</step>
                <step>Initiate or continue CPR.  CPR is to be continued at all times, except during defibrillation and /or interruptions &lt; 10 sec for patient transfer.</step>
                <step>Assure airway patency and begin use of BVM.  Provide initial BLS airway management, including Oropharyngeal or Nasopharyngeal Airway.</step>
                <step>Apply AED or SAED if available.  If AED already in place, wait until current shock sequence completion to switch to another AED or manual monitor – may use previously applied patches if compatible with new unit.</step>
                <step>Follow prompts provided by AED/SAED device.</step>
                <step>Utilize ALS, or initiate timely transport toward ALS (ALS intercept or hospital if closer).  If ALS not available, no more than 3 shocks should be delivered at the scene.  Defibrillation should not be performed in a moving ambulance.</step>
                <step>Advise receiving hospital ASAP.</step>
            <stop level="EMT"/>
            <start level="EMT-I, CC &amp; P"/>
                <step>If AED/SAED not already applied, quick look using manual monitor and defibrillate PRN after CPR of at least 5 cycles (about 2 minutes).  Apply limb leads and pads in between shock sequences as appropriate.</step>
                <step>Obtain vascular access.</step>
                <step>Secure definitive airway.  If BLS airway is sufficient to maintain chest rise, continue until additional time or resources are available.  If unable to intubate, continue use of BLS airway adjuncts or use alternate airway device.<br/><br/>emove Bag Valve device whenever transferring patient, moving patient in and out of Ambulance, or other times 
when Bag Valve device may dislodge the device.<br/><br/>Reassess airway patency after any movement of patient.</step>
            <stop level="EMT-I" />
            <start level="EMT-CC &amp; P"/>
                <step>Give medications as listed in the following specific arrhythmia / dysrhythmia protocols. 
</step>
                <note title="NOTE">Should IV/IO access not be available, Epinephrine, Atropine, and Lidocaine may be administered via ETT under 
direct, on-line Medical Control.</note>
        </protocol></section></page>

PHP5 启用 XML/XSL

想法?有什么明显的吗??


一种可能性是 XSL 处理器确实在抱怨&nbsp;没有被宣布为实体。尝试将文档类型更改为

<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp '&#160;'> ] >
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

XSLTProcessor::importStylesheet() 中的多个 PHP 警告 的相关文章

  • XPath 直到下一个标签

    与之前在这里问过的其他人类似的问题 但由于我不知道如何应用这些建议 所以我需要一些帮助 我想找到一个 html 文档的节点 其结构如下 摘录 可能有所不同 h2 My title 1 h2 h3 Sub heading h3 p span
  • 使用 Javascript 从本地文件夹读取 XML 文件

    我正在尝试学习如何读取 XML 文件中的网页数据 这是一个静态 HTML 页面 我不需要 Web 服务器并且无法使用 Ajax XML 文件是本地的 与 HTML 文件位于同一目录中 我希望它能在 Chrome 浏览器中运行 我需要做的是
  • PHP 矩阵的逆矩阵

    I saw 这个问题 https stackoverflow com questions 211160 python inverse of a matrix 并弹出这个想法 PHP 有没有一种有效的方法来做到这一点 EDIT 最好有演示 你
  • PHP 正则表达式修复被黑的 WordPress 网站

    我有一个客户安装了多个 WordPress 但他没有保持最新状态 结果 他被黑了 当我试图找出黑客是如何进入并永久解决问题时 我正在尝试创建一个脚本来快速 自动地修复它们 我找到了这个脚本 它可以满足我的要求 http designpx c
  • HTML/PHP if-else 语句

    我正在使用 Bootstrap 创建一个网站 我想输入 if else 语句 但我不知道该怎么做 让我解释 Here is an image of my current HTML snippet 现在我想要的是 如果我通过 An Aussc
  • 如何应对本地化?我应该遵循一个标准吗?

    我正在尝试创建一组类来处理本地化 主要是货币部分 但也包括语言 我可以想象其中的逻辑 但我不知道不同的语言和货币使用什么名称 我看到有很多 ISO 标准 我应该选择哪一个 不管怎样 这是我想到的逻辑 以防你也能帮忙解决这个问题 我会有一个
  • gd 的 php 包装类

    谁能推荐一个 gd 库的包装类 我找到了一个few http www bin co com php scripts classes gd image 但它们只具有基本的图像处理功能 例如翻转 倒转等 我真的在这里画画 所以我想要所有的线 点
  • 在 VBScript 中导航 XML 节点(对于 Dummy)

    我正在尝试编写一个脚本来为我操作 xml 文件中的一些数据 我对 VBScript 还很陌生 但有 VB NET 和 VBA 背景 所以我觉得我知道自己在做什么 我认为可能有更好的方法来导航文件 而不是对每一行进行大量调用 InStr 或类
  • 以阿拉伯语显示日期

    这是我的代码 setlocale LC ALL ar echo strftime e b Y strtotime 2011 10 25 Output 25 Sep 2011 为什么不显示阿拉伯日期 我是否错误地使用了 strftime 在这
  • 如何将值从 javascript 传递到 php 文件

    我通过以下方式获取价值JQuery像这样的东西 var query popURL split var dim query 1 split var popWidth dim 0 split 1 Gets the first query str
  • 将多个参数绑定到mysqli查询中

    现在我需要使用以下结构来处理将多个参数绑定到 mysqli 查询中 if words total 1 statement gt bind param s words 0 else if words total 2 statement gt
  • 音频端播放新文件

    我有一个webapp https radio repjesus com当您使用 ajax jquery 单击链接时加载并播放音轨 一切正常 但当曲目结束时 曲目将设置为循环 并且这种情况可以永远持续下去 我希望播放器从数据库中自动加载随机曲
  • 如何在PHP中使用curl GET发送原始数据?

    我正在开发 REST API 虽然很容易在 cURL 中为 POST 请求设置原始 JSON 数据 payload json encode array user gt data attach encoded JSON string to t
  • PHP PDO 与 mysql*() 的安全优势

    使用 PHP PDO 代替 mysql connect 等有任何安全优势吗 不会 与 MySQL 扩展相比 PDO 没有任何安全优势 墨菲定律告诉我们的除外 该定律对两者都适用 两者都会通过转义相同的字符来保证输入安全 然而 PDO 还有其
  • 将数组内爆为来自 mysql 查询的逗号分隔字符串

    在过去的 1 1 2 天里 我一直在尝试将 16 行 id 存储到一个字符串中 并用逗号分隔每个 id 我得到的数组来自 MySQL 我得到的错误是 implode 函数 传递了无效参数 str array string while row
  • 针对 Woocommerce 中多个产品类别计数的 ajax 添加到购物车的 JS 警报

    在 Woocommerce 中 当达到特定产品类别的购物车中的产品的特定数量时 我尝试显示 JavaScript 甜蜜警报 并在达到二级类别的产品的特定数量时显示另一个警报 商品通过 AJAX 添加到购物车 这就是我想使用 JavaScri
  • 如何对 Slim 框架应用程序进行单元测试

    我一直在尝试对修改其他人代码的示例进行单元测试 每次我到达测试运行时都没有错误的程度 当我期望它们通过时 我只是遇到相同的失败 网上没有大量文档 我真的不知道还能去哪里 任何人都可以看到我的代码哪里出错了 bootstrap php php
  • 如何使用 Carbon 获取上个月的第一天和最后一天 - Laravel

    I need First and Last Day of 前一个月使用Carbon Library 我尝试过如下 firstDayofPreviousMonth Carbon now gt startOfMonth gt subMonth
  • PHP 命名空间 - 提升一个级别?

    示例1 命名空间 Inori Test 主测试类 示例2 命名空间 Inori Test SubTest SubTest 类扩展了 问题 有没有办法快速提升命名空间的级别 以便 SubTest 可以扩展 MainTest 就像是 MainT
  • XslCompiledTransform 和自定义 XmlUrlResolver:“具有相同键的条目已存在”

    有没有办法调试由自定义 XmlUrlResolver 从数据库加载的 XSLT 文档 或者有人知道下面的错误消息是关于什么的吗 我有一个导入通用 xslt 文档的 XSLT 样式表

随机推荐

  • 如何在 d3 力定向图中突出显示(更改颜色)所有连接(邻居)节点和链接

    我在这里看到了这个例子http www d3noob org 2013 03 d3js force directed graph example basic html http www d3noob org 2013 03 d3js for
  • Kotlin 中的驱逐队列

    我需要一个集合 有固定的大小 是可变的 添加新元素后将重新索引元素 删除最旧的元素 如移位寄存器 我觉得番石榴EvictingQueue https guava dev releases 15 0 api docs com google c
  • 有没有办法将色调仅应用于seaborn中PairGrid的下部

    我想知道是否可以将色调仅应用于seaborn的下部PairGrid For example say I have the following figure 对于我需要展示的内容 我想将密度图保留在对角线上 将整体散点图保留在上部 在其上方打
  • 连接 Apollo 和 mongodb

    我想将我的 Apollo 服务器与我的 mongoDB 连接 我知道那里有很多例子 但我陷入了异步部分 没有找到解决方案或示例 这很奇怪 我完全错了吗 我从 next js 的示例开始https github com zeit next j
  • “窗口”类型不支持直接内容

    我有一个使用 VS 2015 构建的 WPF 解决方案 由多个项目组成 突然 我开始在设计模式下收到一条警告 内容如下 窗口 类型不支持直接内容 我了解某些控件不支持直接内容 但是System Windows Window应该 我收到同样的
  • Android 编程错误

    我正在使用 Eclipse Galileo 编写 Android 你好 测试 教程 http developer android com resources tutorials testing helloandroid test html
  • ASP.net 页面在导入语句上出现错误,但我确实有引用吗?

    任何想法为什么我在我的 MVC2 项目中收到以下错误 即使在项目本身中我肯定有对 system Web Entity 的引用 Compiler Error Message CS0234 The type or namespace name
  • 后台根据时间激活本地通知

    因此 我有一个包含重复间隔本地通知的应用程序 我想添加一个在睡眠期间暂停通知的功能 到目前为止 我已经为用户创建了两个日期选择器 以指定他们想要停止重复间隔的时间以及自动重新启动的时间 我还为他们添加了一个 uiswitch 来激活睡眠模式
  • 在 PHP 中将 Oauth 2.0 访问令牌传递给 Fusion Tables API 时出现无效凭据错误

    我已经达到了沮丧的地步 正在寻求帮助 我整个周末都在学习新东西 以便尝试弄清楚如何使用需要通过 Oauth 2 0 进行身份验证的 goolge fusion table API 我开始使用 php 进行开发只是因为我能够找到一些帮助我走上
  • 将事件处理程序应用于动态控制

    我有一个用户窗体 可以动态放置commandButton到用户表单上 但我似乎无法正确设置动态事件处理程序 下面显示了我如何设置动态按钮的代码 Set cButton Me Controls Add Forms CommandButton
  • 使 fetch 调用真正同步

    是的 我想完全同步 我知道它会完全停止我唯一的线程 但我真的需要它 因为我使用一些我不想更改的 SDK 并且在这个 SDK 中 您需要传递一个将被调用且会更改的函数那里有一些价值 比如 function onNonce stuff cons
  • 如何使用 Sql Server 2008 删除表中的前 1000 行?

    我在 SQL Server 中有一个表 我想从中删除前 1000 行 但是 我尝试了此操作 但我不是只删除前 1000 行 而是删除了表中的所有行 这是代码 delete from mytab select top 1000 a1 a2 a
  • 如何在AWS EC2服务器中编写cron作业

    我在 AWS EC2 中创建了一个 cron 作业 但它不起作用 我按照以下步骤创建 crontab 第1步 我登录到AWS EC2实例 step 2 crontab e 第三步 插入模式 第4步 我输入了 php var www html
  • 处理多种表单和打印内容[关闭]

    这个问题不太可能对任何未来的访客有帮助 它只与一个较小的地理区域 一个特定的时间点或一个非常狭窄的情况相关 通常不适用于全世界的互联网受众 为了帮助使这个问题更广泛地适用 访问帮助中心 help reopen questions 您好 我对
  • 从 JBPM WorkItemHandler 抛出异常?

    我对从 JBPM 工作项处理程序抛出异常以及在业务流程中的其他地方处理异常的主题有点困惑 我们使用 JBPM 6 0 3 在 Jboss EAP 6 1 中运行 The JBPM 用户指南 http docs jboss org jbpm
  • ExtJS TreeGrid 中的复选框列

    有没有办法在新的 extjs 小部件 TreeGrid 中包含复选框列 将节点属性标记为 false true 并不像 TreePanel 那样有效 Cheers 我修改了 Ext ux tree TreeGridNodeUI 类来实现此功
  • 正则表达式捕获 VBA 注释

    我正在尝试捕获 VBA 注释 到目前为止我有以下内容 Z 它捕获以单引号开头但在字符串末尾之前不包含任何双引号的任何内容 即它不会匹配双引号字符串中的单引号 dim s as string a string variable works s
  • 未知层:当我尝试加载模型时 KerasLayer

    当我尝试将模型另存为 hdf5 时 path path h5 model save path 然后再次加载模型 my reloaded model tf keras models load model path 我收到以下错误 ValueE
  • 运行为黑莓设备创建的黑莓应用程序需要哪些步骤?

    我使用 java me 和 BlackBerry 特定 API 创建了一个 BlackBerry 应用程序 它在黑莓模拟器上运行良好 我想知道如何将此应用程序部署到 BlackBerry 设备 从文档中我发现 在设备上运行 BlackBer
  • XSLTProcessor::importStylesheet() 中的多个 PHP 警告

    Errors Warning XSLTProcessor importStylesheet xsltprocessor importstylesheet Undefined variable in transform php on line