0

我正在尝试使用 Drupal 7 连接到 REST Web 服务。数据是通过 url 提供的,我想将其拉入 D7 站点以创建和填充节点。我正在使用提要模块来映射内容,并使用 Web 服务客户端模块来提取数据,但我不确定使用什么作为数据类型来根据需要剪切和拆分数据。

我有一个看起来像的地址http://192.136.0.31:8080/places/getAll

我使用 Chrome 的 Advanced Rest Client 时返回的 xml:

<ArrayOfAsset>
 <Asset>
    <Address1>01-02 Whatever Road</Address1>
    <Address2>Whatever Town</Address2>
    <City />
    <Country>United Kingdom</Country>
    <County>Whatevershire</County>
    <HouseNumber>0001</HouseNumber>
    <Id>01234ec0e-005456944567</Id>
    <Latitude>58.828424</Latitude>
    <LongTelephoneNumber>01543 534676</LongTelephoneNumber>
    <Longitude>126.054688</Longitude>
    <Name>Whatever the name is</Name>
    <PostCode>WH01 7PU</PostCode>
    <ShortName>Whatever</ShortName>
    <Uri></Uri>
 </Asset>
</ArrayOfAsset>

所以,我的问题是如何拆分/剪切这些数据以返回客户端模块中我需要的部分?

如果还有什么需要我提供的,请告诉我。

更新:通过 Web 服务导出的 xml,虽然看起来 xml 的格式实际上并不相同。

第一行在 Chrome 开发工具中被注释掉,就好像 chrome 自己把它放在那里一样:

<!--?xml version="1.0" encoding="utf-8"?-->

空头标签

<head></head>
<body>

然后直接进入上面的代码。

4

0 回答 0