xslt-仅在特定节点上搜索xml
鉴于:xslt-仅在特定节点上搜索xml,xslt,xslt-1.0,Xslt,Xslt 1.0,鉴于: <document> <xmlNode>Not important here. Sample 1.</xmlNode> <xmlNode>Not important here. Sample 2.</xmlNode> <xmlNode>Not important here. Sample 3.</xmlNode> <target><variable><numb
<document>
<xmlNode>Not important here. Sample 1.</xmlNode>
<xmlNode>Not important here. Sample 2.</xmlNode>
<xmlNode>Not important here. Sample 3.</xmlNode>
<target><variable><number/><ofdescendants><findme/></ofdescendants></variable>Find something in here only.</target>
<xmlNode>Not important here. Sample 5.</xmlNode>
<xmlNode>Not important here. Sample 6.</xmlNode>
</document>
这里不重要。样本1。
这里不重要。样本2。
这里不重要。样本3。
只在这里找些东西。
这里不重要。样本5。
这里不重要。样本6。
使用xslt,如何匹配可以出现在目标子代中任何位置的元素
如何匹配可以出现在目标子体中任何位置的元素
匹配元素
,但仅在/document/target
根目录树中的位置路径,最容易通过使用子体
轴或子体或自身
轴来构建,如果
本身被视为候选:
/document/target/descendant::e
或
后者可以缩写为
/document/target//e
这些都是绝对位置路径或路线。你也可以建立相对的关系,这可能就是你所需要的。详细信息取决于整个样式表和将从中选择这些节点进行转换的上下文。您是否尝试过
?你到底试了什么?你说的“搜索”是什么意思?这不是XSLT概念。您是否正在尝试编写一个或多个仅与
及其子体匹配的位置路径?您是否正在尝试编写只转换该子树的转换?也许是别的?我想感谢你的额外见解
/document/target//e