如何在java中读取xml标记元素中的文本

如何在java中读取xml标记元素中的文本,java,xml-parsing,Java,Xml Parsing,我能够使用java读取标记之间的文本,但我还需要读取标记内的值 <Events> <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><System><Provider Name="Microsoft-Windows-PrintService" Guid="{747ef6fd-e535-4d16-b510-42c90f6873a1}"></Provider&

我能够使用java读取标记之间的文本,但我还需要读取标记内的值

<Events>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><System><Provider Name="Microsoft-Windows-PrintService" Guid="{747ef6fd-e535-4d16-b510-42c90f6873a1}"></Provider>
<EventID Qualifiers="">800</EventID>
<Version>0</Version>
<Level>4</Level>
<Task>43</Task>
<Opcode>1</Opcode>
<Keywords>0x4004000000000000</Keywords>
<TimeCreated SystemTime="2019-11-17 09:25:22.909933"></TimeCreated>
<EventRecordID>1</EventRecordID>
<Correlation ActivityID="" RelatedActivityID=""></Correlation>
<Execution ProcessID="1428" ThreadID="8052"></Execution>
<Channel>Microsoft-Windows-PrintService/Operational</Channel>
<Computer>DESKTOP-0QUNS51</Computer>
<Security UserID="S-1-5-21-3467767592-1575844298-3693013382-1002"></Security>
</System>
<UserData><JobDiag xmlns="http://manifests.microsoft.com/win/2005/08/windows/printing/spooler/core/events"><JobId>8</JobId>
</JobDiag>
</UserData>
</Event>

800
0
4.
43
1.
0x4004000000000000
1.
Microsoft Windows PrintService/Operational
桌面-0QUNS51
8.

发布您的代码和xml,需要获取SystemTimevalue@Rahul-请您的问题添加一些解释或代码,而不是像您那样使用注释。您应该使用DOM或SAX解析器来遍历xml文件,并通过示例xml获取SystemTime值