0

この XSLT 変換を達成するのを手伝ってくれませんか? 関係逆転みたいな…

Offers/Offer*/TrimLine*/PRNumber* がある ---> PRNumbers/PRNumber*/TrimLine*/Offer* に変換したい

入力:

    <offerStructures>
    <offerStructure>
        <productId>1</productId>
        <brandName>OS</brandName>
        <trimLines>
            <trimLine>
                <productId>12</productId>
                <trimLineName>12TL</trimLineName>
                <prNumbers>
                    <prNumber>
                        <productId>1</productId>
                        <countryCode>IN</countryCode>
                        <brandName>OKI</brandName>
                    </prNumber>
                    <prNumber>
                        <productId>2</productId>
                        <countryCode>US</countryCode>
                        <brandName>LOP</brandName>
                    </prNumber>
                </prNumbers>
            </trimLine>
            <trimLine>
                <productId>13</productId>
                <trimLineName>13TL</trimLineName>
                <prNumbers>
                    <prNumber>
                        <productId>1</productId>
                        <countryCode>IN</countryCode>
                        <brandName>PYU</brandName>
                    </prNumber>
                    <prNumber>
                        <productId>3</productId>
                        <countryCode>AU</countryCode>
                        <brandName>ABC</brandName>
                    </prNumber>
                </prNumbers>
            </trimLine>
        </trimLines>
    </offerStructure>
    ../Multiple Offer Structure
</offerStructures>

必要な出力:

<prNumbers>
    <prNumber>
        <productId>1</productId>
        <countryCode>IN</countryCode>
        <brandName>PYU</brandName>
        <trimLine>
            <productId>13</productId>
            <trimLineName>13TL</trimLineName>
            <offerStructure>
                <productId></productId>
            </offerStructure>
            <offerStructure>
                <productId></productId>
            </offerStructure>
        </trimLine>
        <trimLine>
            <productId>12</productId>
            <trimLineName>12TL</trimLineName>
        </trimLine>
    </prNumber>
    <prNumber>
        <productId>2</productId>
        <countryCode>US</countryCode>
        <brandName>LOP</brandName>
        <trimLine>
            <productId>12</productId>
            <trimLineName>12TL</trimLineName>
            <offerStructure>
                <productId></productId>
            </offerStructure>
        </trimLine>
    </prNumber>
    <prNumber>
        <productId>3</productId>
        <countryCode>AU</countryCode>
        <brandName>ABC</brandName>
        <trimLine>
            <productId>13</productId>
            <trimLineName>13TL</trimLineName>
        </trimLine>
    </prNumber>
</prNumbers>

ありがとう

4

1 に答える 1