Informatica B2B преобразование данных - PullRequest
2 голосов
/ 20 октября 2011

Я пытаюсь обработать xsd: выбор в механизме преобразования B2B.

( здесь xsd примеры )

То есть у меня

enter image description here

И я заинтересован только в том, чтобы получить "одну" часть

И я хочу извлечь только «один» элемент, не обращая внимания на то, из какого базового типа он происходит, то есть я хочу поместить результат в «один» ниже независимо от того, исходит ли он от штуки один, штука две или штука три.

enter image description here

В терминах XSLT я хотел бы сделать:

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.differentthingies.com/20111119/thingy" xsi:schemaLocation="http://xmlns.differentthingies.com/20111119/thingy differentthinggies.xsd">
    <differentthingies>
        <thingythree>
            <one>thisisthingythree1</one>
            <three2>thisisthingythree2</three2>
            <three3>thisisthingythree3</three3>
        </thingythree>
    </differentthingies>
</root>

Преобразовано

<xsl:template match="/">
        <xsl:variable name="var1_root" select="ns0:root"/>
        <root xmlns="http://xmlns.differentthingies.com/20111119/anotherthingy">
            <xsl:attribute name="xsi:schemaLocation" namespace="http://www.w3.org/2001/XMLSchema-instance">http://xmlns.differentthingies.com/20111119/anotherthingy thingy.xsd</xsl:attribute>
            <thingyone>
                <xsl:for-each select="$var1_root/ns0:differentthingies/ns0:thingyone/ns0:one">
                    <one>
                        <xsl:value-of select="string(.)"/>
                    </one>
                </xsl:for-each>
                <xsl:for-each select="$var1_root/ns0:differentthingies/ns0:thingythree/ns0:one">
                    <one>
                        <xsl:value-of select="string(.)"/>
                    </one>
                </xsl:for-each>
                <xsl:for-each select="$var1_root/ns0:differentthingies/ns0:thingytwo/ns0:one">
                    <one>
                        <xsl:value-of select="string(.)"/>
                    </one>
                </xsl:for-each>
            </thingyone>
        </root>
    </xsl:template>

станет

<root xmlns="http://xmlns.differentthingies.com/20111119/anotherthingy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.differentthingies.com/20111119/anotherthingy thingy.xsd">
    <thingyone>
        <one>thisisthingythree1</one>
    </thingyone>
</root>
...