为什么来自dita-ot的xpath
"*[contains(@class, ' topic/topic ')]/*[contains(@class, ' topic/title ')]
匹配文本节点“入门”吗?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "http://docs.oasis-open.org/dita/v1.1/OS/dtd/concept.dtd">
<concept id="mobileapp_gs" rev="3">
<title>Getting started</title>
<conbody>
</conbody>
</concept>
问候 继续
答案 0 :(得分:4)
DTD可以提供默认属性值。此处理在应用任何XPath表达式之前进行。您在此处引用的DTD有点复杂,但是如果我在其上运行标识XSLT样式表(获取输入,从DTD填写任何默认值,然后将其复制出来),则预处理后的输入看起来更像(格式很浅)>
<?xml version="1.0"?>
<concept xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"
id="mobileapp_gs"
rev="3"
ditaarch:DITAArchVersion="1.1"
domains="(topic ui-d) (topic hi-d) (topic pr-d) (topic sw-d) (topic ut-d) (topic indexing-d)"
class="- topic/topic concept/concept ">
<title class="- topic/title ">Getting started</title>
<conbody class="- topic/body concept/conbody ">
</conbody>
</concept>
在此步骤之后,显然<concept />
元素具有包含class
的{{1}}属性,而子元素具有包含topic/topic
的{{1}}属性。