简单的xpath在给定的xml上不起作用

时间:2019-05-08 18:08:47

标签: xml xpath

我有一个源xml。正在为其应用xpath。它不起作用。下面是xml和xpath。 xpath在我的工具中不起作用。但是当我使用https://www.freeformatter.com测试时,它可以正常工作 我的工具使用的xpath处理器有问题吗?

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xml:base="https://collaboration.merck.com/sites/amseimcts/_api/">
   <id>d38a1da2-02e9-467e-b59b-e520c8607914</id>
   <title />
   <updated>2019-05-08T10:54:04Z</updated>
   <entry>
      <id>https://collaboration.merck.com/sites/amseimcts/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared Documents/SAP Config/OBA1.csv')</id>
      <category term="SP.File" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
      <link rel="edit" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Author" type="application/atom+xml;type=entry" title="Author" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/Author" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CheckedOutByUser" type="application/atom+xml;type=entry" title="CheckedOutByUser" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/CheckedOutByUser" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/EffectiveInformationRightsManagementSettings" type="application/atom+xml;type=entry" title="EffectiveInformationRightsManagementSettings" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/EffectiveInformationRightsManagementSettings" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/InformationRightsManagementSettings" type="application/atom+xml;type=entry" title="InformationRightsManagementSettings" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/InformationRightsManagementSettings" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ListItemAllFields" type="application/atom+xml;type=entry" title="ListItemAllFields" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/ListItemAllFields" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/LockedByUser" type="application/atom+xml;type=entry" title="LockedByUser" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/LockedByUser" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/ModifiedBy" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Properties" type="application/atom+xml;type=entry" title="Properties" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/Properties" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/VersionEvents" type="application/atom+xml;type=feed" title="VersionEvents" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/VersionEvents" />
      <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Versions" type="application/atom+xml;type=feed" title="Versions" href="Web/GetFileByServerRelativePath(decodedurl='/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv')/Versions" />
      <title />
      <updated>2019-05-08T10:54:04Z</updated>
      <author>
         <name />
      </author>
      <content type="application/xml">
         <m:properties>
            <d:CheckInComment />
            <d:CheckOutType m:type="Edm.Int32">2</d:CheckOutType>
            <d:ContentTag>{87637609-7D7C-466B-A60B-5BD7A028712C},6,6</d:ContentTag>
            <d:CustomizedPageStatus m:type="Edm.Int32">0</d:CustomizedPageStatus>
            <d:ETag>"{87637609-7D7C-466B-A60B-5BD7A028712C},6"</d:ETag>
            <d:Exists m:type="Edm.Boolean">true</d:Exists>
            <d:IrmEnabled m:type="Edm.Boolean">false</d:IrmEnabled>
            <d:Length m:type="Edm.Int64">447</d:Length>
            <d:Level m:type="Edm.Byte">1</d:Level>
            <d:LinkingUri>https://collaboration.merck.com/sites/amseimcts/Shared%20Documents/SAP%20Config/OBA1.csv?d=w876376097d7c466ba60b5bd7a028712c</d:LinkingUri>
            <d:LinkingUrl>https://collaboration.merck.com/sites/amseimcts/Shared Documents/SAP Config/OBA1.csv?d=w876376097d7c466ba60b5bd7a028712c</d:LinkingUrl>
            <d:MajorVersion m:type="Edm.Int32">4</d:MajorVersion>
            <d:MinorVersion m:type="Edm.Int32">0</d:MinorVersion>
            <d:Name>OBA1.csv</d:Name>
            <d:ServerRelativeUrl>/sites/amseimcts/Shared Documents/SAP Config/OBA1.csv</d:ServerRelativeUrl>
            <d:TimeCreated m:type="Edm.DateTime">2019-05-05T10:50:02Z</d:TimeCreated>
            <d:TimeLastModified m:type="Edm.DateTime">2019-05-07T12:08:57Z</d:TimeLastModified>
            <d:Title m:null="true" />
            <d:UIVersion m:type="Edm.Int32">2048</d:UIVersion>
            <d:UIVersionLabel>4.0</d:UIVersionLabel>
            <d:UniqueId m:type="Edm.Guid">87637609-7d7c-466b-a60b-5bd7a028712c</d:UniqueId>
         </m:properties>
      </content>
   </entry>
</feed>

xpath:feed / entry / content / m:properties / d:Name / text()

编辑: 下面是三个链接,它们仅在标题上类似于我的查询,但内容方面我的查询是不同的。我在链接文本本身中给出了以下链接的简短描述。

simple xpath not working because of some mistake in the xpath

simple xpath not working because there is some problem in the source xml itself

simple xpath not working because there is a problem in the source xml itself

我的要求:当我在https://www.freeformatter.com中进行测试时,我的XPATH可以正常工作,但在使用XERCES xslt处理器的工具中却无法工作。 我遇到任何错误吗?否,很简单,没有任何结果,它是空白。同样,当我尝试使用xpath tester 时也没有得到任何结果!

0 个答案:

没有答案