2 回答

TA貢獻(xiàn)1719條經(jīng)驗(yàn) 獲得超6個(gè)贊
您的 XPointer 不正確,因?yàn)槿绻?a 開頭,/
則意味著您正在從文檔的根目錄開始。因此,如果您這樣做,/sulu:properties/sulu:property
XPointer 會(huì)假定properties
您嘗試包含的文件的根目錄應(yīng)該有一個(gè)標(biāo)簽。我的建議是您創(chuàng)建一個(gè)類似的文件(這也顯示在本標(biāo)題文檔中的最后一個(gè)代碼片段中):
<?xml version="1.0" ?>
<properties xmlns="http://schemas.sulu.io/template/template"
? ? ? ? ? ? xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
? ? ? ? ? ? xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.1.xsd">
? ? <property name="url" type="resource_locator" mandatory="true">
? ? ? ? <meta>
? ? ? ? ? ? <title>Resourcelocator</title>
? ? ? ? </meta>
? ? ? ? <tag name="sulu.rlp"/>
? ? </property>
? ? ? ??
? ? <property name="title" type="text_line" mandatory="true">?
? ? ? ? <meta>
? ? ? ? ? ? <title>Title</title>?
? ? ? ? </meta>
? ? ? ? <params>
? ? ? ? ? ?<param name="headline" value="true"/>?
? ? ? ? </params>
? ? ? ? <tag name="sulu.rlp.part"/>
? ? </property>
? ? <property name="article" type="text_editor">
? ? ? ? <meta>
? ? ? ? ? ? <title>Article</title>
? ? ? ? </meta>
? ? </property>
</properties>
通過(guò)這種方式,您還可以刪除不必要的元素,例如view和controller標(biāo)簽,在本例中不需要這些元素。
或者,您也可以調(diào)整包含的 XPointer:
<xi:include href="include.xml" xpointer="xmlns(sulu=http://schemas.sulu.io/template/template)xpointer(/sulu:template/sulu:properties/sulu:property)" />
sulu:template注意xpointer 開頭的附加內(nèi)容。

TA貢獻(xiàn)1815條經(jīng)驗(yàn) 獲得超10個(gè)贊
我有同樣的錯(cuò)誤消息。但就我而言,這是 xpointer 定義中的語(yǔ)法錯(cuò)誤。我寫
<xi:include
href="default.xml"
xpointer="xmlns(sulu=http://schemas.sulu.io/template/template)
xpointer(/sulu:template/sulu:properties/sulu:property"/>
<!-- _____________________________________________________________^ -->
不知何故,我忘記了 xpointer 屬性末尾的右括號(hào)。
- 2 回答
- 0 關(guān)注
- 121 瀏覽
添加回答
舉報(bào)