我有以下XML文档:我的xpath有什么问题?
<Item>
<DataContainer>
<ComponentId>12</ComponentId>
<ChangeTo>undefined</ChangeTo>
<OperationCode>ADD</OperationCode>
<ComponentTableName>invFeatureType</ComponentTableName>
<ComponentColName>invFeatureTypeId</ComponentColName>
<Type>Feature</Type>
<PlanFeatureName>Long Distance</PlanFeatureName>
<ToPlanFeatureName/>
</DataContainer>
</Item>
当我申请以下XPath来选择特定的节点:
"/Item/DataContainer[ChangeTo = '12' and Type='Feature']")
我收到以下错误:
Uncaught DOMException: Failed to execute 'evaluate' on 'Document': The string '/ITEM/DATACONTAINER[CHANGETO = '12' AND TYPE='FEATURE']' is not a valid XPath expression
任何想法??
在开始时加入''''或'/'。 – eLRuLL
我加了它,但没有解决问题 – Abadi
请更新你的问题,你的例子中没有'Collection'标签,并且你还没有更新它的建议。也是现在给出同样的错误? – eLRuLL