将命名空间属性从 XML 移动到顶部
你好,朋友们,我有以下类型的 XML
<wsp:Policy wsu:Id="p1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<sp:Body />
</sp:SignedParts>
</wsp:Policy>
,但我想将其转换为以下格式,
<wsdl:definitions
xmlns:sp=http://schemas.xmlsoap.org/ws/2005/07/securitypolicy
xmlns:wsp=http://schemas.xmlsoap.org/ws/2004/09/policy
xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd>
<wsp:Policy wsu:Id="p1" >
<sp:SignedParts>
<sp:Body />
</sp:SignedParts>
</wsp:Policy>
</wsdl:definitions>
您能告诉我如何通过 LINQ 或任何其他 API 执行此操作吗
Hello friends I m having following type of XML
<wsp:Policy wsu:Id="p1" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<sp:Body />
</sp:SignedParts>
</wsp:Policy>
But I want to convert it into following format
<wsdl:definitions
xmlns:sp=http://schemas.xmlsoap.org/ws/2005/07/securitypolicy
xmlns:wsp=http://schemas.xmlsoap.org/ws/2004/09/policy
xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-utility-1.0.xsd>
<wsp:Policy wsu:Id="p1" >
<sp:SignedParts>
<sp:Body />
</sp:SignedParts>
</wsp:Policy>
</wsdl:definitions>
Can you please tell how to do this either through LINQ or any other API
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)