简体   繁体   English

eXist-db上的XML:err:XPST0003意外令牌

[英]XML on eXist-db : err:XPST0003 unexpected token

I have an XML document on eXist-db but the compiler is complaining giving me the following error: 我在eXist-db上有一个XML文档,但是编译器抱怨给我以下错误:

Cannot compile xquery: exerr:ERROR org.exist.xquery.XPathException: err:XPST0003 unexpected token: xml-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl" [at line 2, column 1] 无法编译xquery:exerr:ERROR org.exist.xquery.XPathException:err:XPST0003意外令牌:xml-stylesheet href =“ ../ xsltforms / xsltforms.xsl” type =“ text / xsl” [在第2行,第1列]

I have tried everything I could think of: 我已经尝试了所有我能想到的:

  • copying the xml on to an xhtml document. 将xml复制到xhtml文档。
  • removing the tags that it's complaining about ( but it then goes to complain about other tags) 删除它抱怨的标签(但是随后它会抱怨其他标签)
  • run the xml in eXist with no result 在eXist中运行xml,没有结果
  • run the html generated by it in the browser with another error too. 在浏览器中运行它生成的html,同时出现另一个错误。

This is the relevant part of the XML I think: 我认为这是XML的相关部分:

nuevacontribucion.xml nuevacontribucion.xml

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl" ?><?css-conversion no?><?xsltforms-options debug="no"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
    <title>Crear una nueva Contribución</title>
    <link href="../css/loading.css" rel="stylesheet"/>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"/>
    <link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen"/>
    <link href="assets/styles.css" rel="stylesheet" media="screen"/>
        <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="vendors/flot/excanvas.min.js"></script><![endif]-->
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    <script src="vendors/modernizr-2.6.2-respond-1.1.0.min.js"/>
    <style>
        input[type='text'], select{
            min-height: 30px;
        }
        iframe{
            width: 100% !important;
            height: 200px !important;
        }
        .datepicker .aid-button{
            display: none !important;
        }
    </style>

If I remove the xml-stylesheet tag then it throws the same exception but complaining about css-conversion, if I remove it then it's about the following tag, if I remove it then it's about xmlns not being defined or something. 如果我删除xml-stylesheet标记,那么它将引发相同的异常,但会抱怨css-conversion,如果我将其删除,则是关于以下标记,如果我将其删除,则是关于未定义xmlns或其他内容。

Change the XSLT engine from Saxon to Xalan. 将XSLT引擎从Saxon更改为Xalan。

By default, eXist-db 2.0 comes with the following configuration in conf.xml in the eXist-db install directory: 默认情况下,eXist-db 2.0在eXist-db安装目录的conf.xml中具有以下配置:

 <transformer class="net.sf.saxon.TransformerFactoryImpl">

To solve your problem, change it to: 要解决您的问题,请将其更改为:

<transformer class="org.apache.xalan.processor.TransformerFactoryImpl">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 xpst0003 xquery语法错误 - xpst0003 xquery syntax error XQuery错误XPST0003语法错误 - XQuery error XPST0003 syntax error exerr:ERROR err:XPST0003:EOF或零长度的字符串在期望有效的XPath表达式中找到 - exerr:ERROR err:XPST0003: EOF or zero-length string found where a valid XPath expression was expected XPST0003 FLWOR表达式不完整:预期为“返回”。 即使我包括了它 - XPST0003 Incomplete FLWOR expression: expecting 'return'. even though I have included it Xquery处理错误(saxon)XPST0003:“>”的左操作数需要括号 - Xquery processing error (saxon) XPST0003: Left operand of '>' needs parentheses xpath 属性与 &amp; 号 () 引发错误'XPST0003: 没有关闭';' 为实体或字符参考找到' - xpath attribute with ampersand ( ) throws error 'XPST0003: No closing ';' found for entity or character reference' 如何使用 eXist-db 将结果“拼接”成单个 XML 文档? - How to "stitch together" results into a single XML document with eXist-db? 如何使用 eXist-db 和 xsltForms 通过浏览器编辑 xml 文件 - How to edit a xml file via browser with eXist-db and xsltForms 如何从xml数据创建svg(用于Exist-DB) - How to create svg from xml data (for use in Exist-DB) eXist-db中XML文档中的命名空间返回空的API调用 - Namespaces in XML documents in eXist-db returns empty API calls
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM