我有以下xml示例:
<ParentTag xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ID="68067108" ClientID="1" DocumentCreationDate="2018-04-10T00:00:05" DocumentVersion="9" EventClassID="1987" STBLogCreationDate="2018-04-09T11:38:59" SampleID="496" xsi:noNamespaceSchemaLocation="/opt/web/ams_proxy/webapps/ams_proxy/WEB-INF/amsXmlSchema_DTVPA_Version9.xsd">
<Event EventTime="2018-04-09T11:41:02">
<LiveViewEvent>
<Channel channelObjectId="3062323">
<Stream streamId="40" streamType="Video"/>
<Stream streamId="41" streamType="Audio"/>
<Stream streamId="65535" streamType="Data"/>
</Channel>
</LiveViewEvent>
</Event>
</ParentTag>
我需要ParentTag中的id,EventTime和LiveViewEvent数据(channelObject,视频,音频和数据)。我得到了LiveViewEvent(作为结构)和EventTime中的数据,但似乎跳过了ParentTag中的属性。也许我还应该提到其他类型的事件(比具有不同数据的LiveViewEvent但我不需要它们)。
任何帮助都非常感谢。
谢谢,
我认为唯一的方法是在AWS Glue控制台中创建一个分类器,将Row标签作为“ParentTag”,然后您就可以使用struct和array数据类型选择必要的数据。