使用 XSLT 检索 XML 的某些节点,如果节点具有名称空间,则会出现问题。!
如何使用以下 XML 中的命名空间检索名字
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<rpc:ConQueryByExampleResponse
xmlns:rpc="http://siebel.com/asi/">
<SiebelMessage>
<ListOfContactInterfaceMobile
xmlns="http://www.siebel.com/xml/Contact%20Interface%20Mobile">
<Contact>
<FirstName>Siebel</FirstName>
<JobTitle>Sys Admin</JobTitle>
<LastName>Administrator</LastName>
<PersonUId>0-1</PersonUId>
<PersonalContact>Nva</PersonalContact>
<PrimaryOrganization>dga</PrimaryOrganization>
</Contact>
<Contact>
<FirstName>xyz</FirstName>
<JobTitle>Sn</JobTitle>
<LastName>Admin</LastName>
<PersonUId>0-2</PersonUId>
<PersonalContact>Nar</PersonalContact>
<PrimaryOrganization>adfg</PrimaryOrganization>
</Contact>
</ListOfContactInterfaceMobile>
</SiebelMessage>
</rpc:ConQueryByExampleResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
how to retrieve the first names using namespaces in the following XML
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<rpc:ConQueryByExampleResponse
xmlns:rpc="http://siebel.com/asi/">
<SiebelMessage>
<ListOfContactInterfaceMobile
xmlns="http://www.siebel.com/xml/Contact%20Interface%20Mobile">
<Contact>
<FirstName>Siebel</FirstName>
<JobTitle>Sys Admin</JobTitle>
<LastName>Administrator</LastName>
<PersonUId>0-1</PersonUId>
<PersonalContact>Nva</PersonalContact>
<PrimaryOrganization>dga</PrimaryOrganization>
</Contact>
<Contact>
<FirstName>xyz</FirstName>
<JobTitle>Sn</JobTitle>
<LastName>Admin</LastName>
<PersonUId>0-2</PersonUId>
<PersonalContact>Nar</PersonalContact>
<PrimaryOrganization>adfg</PrimaryOrganization>
</Contact>
</ListOfContactInterfaceMobile>
</SiebelMessage>
</rpc:ConQueryByExampleResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果将是
Siebelxyz
。只是 google
xpath 默认命名空间< /code>,这是有史以来最多的常见问题解答。
Result will be
Siebelxyz
.Just google
xpath default namespace
, it's the most FAQ ever.