我正在尝试获取信息<l7:Name>和相应的所有<l7:IssuerName>

<?xml version="1.0" encoding="UTF-8"?>

<l7:List xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
    <l7:Item>
        <l7:Name>services.company.int</l7:Name>
        <l7:Id>00000000000000000000000000000004:-services.company.int</l7:Id>
        <l7:Type>SSG_KEY_ENTRY</l7:Type>
        <l7:TimeStamp>2018-08-28T10:25:04.615-05:00</l7:TimeStamp>
        <l7:Link rel="self" uri="https://10.154.244.13:443/restman/1.0/privateKeys/00000000000000000000000000000004:-services.company.int"/>
        <l7:Resource>
            <l7:PrivateKey alias="-services.company.int" keystoreId="00000000000000000000000000000004" id="00000000000000000000000000000004:-services.company.int">
                <l7:CertificateChain>
                    <l7:CertificateData>
                        <l7:IssuerName>CN=MC Access Management sub CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>
                        <l7:SerialNumber>83060681499471284401614700485002472352</l7:SerialNumber>
                        <l7:SubjectName>DC=net,DC=company,O=company WorldWide - CentralAuth,OU=xmlgw-auth-client,CN=services.company.int</l7:SubjectName>
                    </l7:CertificateData>
                    <l7:CertificateData>
                        <l7:IssuerName>CN=Access Management root CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>


                    </l7:CertificateData>
                    <l7:CertificateData>
                        <l7:IssuerName>CN=Access Management root CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>

                    </l7:CertificateData>
                </l7:CertificateChain>
                <l7:Properties>
                    <l7:Property key="keyAlgorithm">
                        <l7:StringValue>RSA</l7:StringValue>
                    </l7:Property>
                </l7:Properties>
            </l7:PrivateKey>
        </l7:Resource>
    </l7:Item>
    <l7:Item>
        <l7:Name>directory-company-com</l7:Name>
        <l7:Id>00000000000000000000000000000004:--directory-company-com</l7:Id>
        <l7:Type>SSG_KEY_ENTRY</l7:Type>
        <l7:TimeStamp>2018-08-28T10:25:04.615-05:00</l7:TimeStamp>

        <l7:Resource>
            <l7:PrivateKey alias="--directory-company-com" keystoreId="00000000000000000000000000000004" id="00000000000000000000000000000004:--directory-company-com">
                <l7:CertificateChain>
                    <l7:CertificateData>
                        <l7:IssuerName>CN=PRD company 3DS1 Issuer Sub CA,OU=company Identity Check Gen 3,O=company,C=US</l7:IssuerName>

                        <l7:SubjectName>CN=.directory.company.com,OU=gateway-signing,O=company Worldwide,C=US</l7:SubjectName>

                    </l7:CertificateData>
                    <l7:CertificateData>
                        <l7:IssuerName>CN=PRD company Identity Check Root CA,OU=company Identity Check Gen 3,O=company,C=US</l7:IssuerName>
                        <l7:SerialNumber>231453887433606512122984068379445229638</l7:SerialNumber>
                        <l7:SubjectName>CN=PRD company 3DS1 Issuer Sub CA,OU=company Identity Check Gen 3,O=company,C=US</l7:SubjectName>

                    </l7:CertificateData>
                    <l7:CertificateData>
                        <l7:IssuerName>CN=PRD company Identity Check Root CA,OU=company Identity Check Gen 3,O=company,C=US</l7:IssuerName>

                        <l7:SubjectName>CN=PRD company Identity Check Root CA,OU=company Identity Check Gen 3,O=company,C=US</l7:SubjectName>

                    </l7:CertificateData>
                </l7:CertificateChain>
                <l7:Properties>
                    <l7:Property key="keyAlgorithm">
                        <l7:StringValue>RSA</l7:StringValue>
                    </l7:Property>
                </l7:Properties>
            </l7:PrivateKey>
        </l7:Resource>
    </l7:Item>
</l7:List>


我已经试过了/l7:List/l7:Item/l7:Resource/l7:PrivateKey/l7:CertificateChain/l7:CertificateData/l7:IssuerName
/l7:List/l7:Item/l7:Name

我正在努力将两者关联起来。

任何建议都会有所帮助。



更新资料

期望的输出

 <l7:Name>services.company.int</l7:Name>

<l7:IssuerName>CN=MC Access Management sub CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>
<l7:IssuerName>CN=Access Management root CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>

最佳答案

这个XPath

/l7:List/l7:Item//*[self::l7:Name or self::l7:IssuerName]


将选择

<l7:Name>services.company.int</l7:Name>
<l7:IssuerName>CN=MC Access Management sub CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>
<l7:IssuerName>CN=Access Management root CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>
<l7:IssuerName>CN=Access Management root CA,OU=Global Information Security,O=company WorldWide,DC=company,DC=net</l7:IssuerName>
<l7:Name>directory-company-com</l7:Name>
<l7:IssuerName>CN=PRD company 3DS1 Issuer Sub CA,OU=company Identity Check Gen 3,O=company,C=US</l7:IssuerName>
<l7:IssuerName>CN=PRD company Identity Check Root CA,OU=company Identity Check Gen 3,O=company,C=US</l7:IssuerName>
<l7:IssuerName>CN=PRD company Identity Check Root CA,OU=company Identity Check Gen 3,O=company,C=US</l7:IssuerName>


我相信这可以满足您的要求


信息<l7:Name>及其对应的所有<l7:IssuerName>

10-05 20:10