合并在唯一 ID 中具有相同 ID 但包含所有子节点的节点的子节点
又是一个类似的问题,但现在结果包含多个孩子。
有什么帮助吗?
我有这个:
<root>
<rowdata>
<ID>1</ID>
<pxPages>
<rowdata>
<comment>comment A</comment>
<timestamp>timestamp A</timestamp>
<userID>user A</userID>
</rowdata>
</pxPages>
</rowdata>
<rowdata>
<ID>2</ID>
<pxPages>
<rowdata>
<comment>comment B</comment>
<timestamp>timestamp B</timestamp>
<userID>user B</userID>
</rowdata>
</pxPages>
</rowdata>
<rowdata>
<ID>2</ID>
<pxPages>
<rowdata>
<comment>comment C</comment>
<timestamp>timestamp C</timestamp>
<userID>user C</userID>
</rowdata>
</pxPages>
</rowdata>
并寻找:
<root>
<ResultOperationalStatusCategory>
<identifier>1</identifier>
<comments>
<comment>comment A</comment>
<timestamp>timestamp A</timestamp>
<userID>user A</userID>
</comments>
</ResultOperationalStatusCategory>
<ResultOperationalStatusCategory>
<identifier>2</identifier>
<comments>
<comment>comment B</comment>
<timestamp>timestamp B</timestamp>
<userID>user B</userID>
</comments>
<comments>
<comment>comment C</comment>
<timestamp>timestamp C</timestamp>
<userID>user C</userID>
</comments>
</ResultOperationalStatusCategory>
因此,结果是每个唯一标识符,但包含所有注释。
谢谢!
Again a similar question but now the result is containing multiple childs.
any help?
I have this:
<root>
<rowdata>
<ID>1</ID>
<pxPages>
<rowdata>
<comment>comment A</comment>
<timestamp>timestamp A</timestamp>
<userID>user A</userID>
</rowdata>
</pxPages>
</rowdata>
<rowdata>
<ID>2</ID>
<pxPages>
<rowdata>
<comment>comment B</comment>
<timestamp>timestamp B</timestamp>
<userID>user B</userID>
</rowdata>
</pxPages>
</rowdata>
<rowdata>
<ID>2</ID>
<pxPages>
<rowdata>
<comment>comment C</comment>
<timestamp>timestamp C</timestamp>
<userID>user C</userID>
</rowdata>
</pxPages>
</rowdata>
and looking for:
<root>
<ResultOperationalStatusCategory>
<identifier>1</identifier>
<comments>
<comment>comment A</comment>
<timestamp>timestamp A</timestamp>
<userID>user A</userID>
</comments>
</ResultOperationalStatusCategory>
<ResultOperationalStatusCategory>
<identifier>2</identifier>
<comments>
<comment>comment B</comment>
<timestamp>timestamp B</timestamp>
<userID>user B</userID>
</comments>
<comments>
<comment>comment C</comment>
<timestamp>timestamp C</timestamp>
<userID>user C</userID>
</comments>
</ResultOperationalStatusCategory>
so, result is per unique identifier but containing all comments.
thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)