Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <contact>
- <id>239763415</id>
- <first_name>abc</first_name>
- <last_name>bbb</last_name>
- <email>
- <id>230417772952</id>
- <email_address>some@something.com</email_address>
- <is_primary>true</is_primary>
- </email>
- <phone>
- <id>327466887779</id>
- <phone_number>7738908907</phone_number>
- <extension>8907</extension>
- <country_code>1</country_code>
- <display_name>17738908907</display_name>
- <is_primary>true</is_primary>
- <type_id>1201</type_id>
- <type_code>Office</type_code>
- </phone>
- <phone>
- <id>327466890</id>
- <phone_number>312405226463</phone_number>
- <country_code>1</country_code>
- <display_name>13124056463</display_name>
- <is_primary>false</is_primary>
- <type_id>1202</type_id>
- <type_code>Mobile</type_code>
- </phone>
- some@something.com,7738908907,312405226463
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:ns="http://target.com/2012/03/01/canonical/BusinessPartner">
- <xsl:strip-space elements="*" />
- <xsl:output method="text" version="1.0" encoding="UTF-8" indent="yes"/>
- <xsl:template match="/">bp_name|last_name|first_name|job_title|email_address|phone_numb er_1|phone_number_2|responsibility_name
- <xsl:for-each select="ns:bp_list/ns:bp">
- <xsl:variable name="bp_name" select="ns:bp_name" />
- <xsl:for-each select="ns:contact">
- <xsl:value-of select="$bp_name"/>|<xsl:value-of select="normalize-space(ns:last_name)"/>|<xsl:value-of select="normalize-space(ns:first_name)"/>|<xsl:for-each select="(ns:bp_contact/ns:job_title)">
- <xsl:value-of select="(ns:name)"/>
- <xsl:if test="position() != last()">
- <xsl:text>;</xsl:text>
- </xsl:if>
- </xsl:for-each>|<xsl:value-of select="normalize-space(ns:email/ns:email_address)"/>|<xsl:for-each select="(ns:bp_contact/ns:role/ns:responsibility)">
- <xsl:value-of select="(ns:responsibility_name)"/>
- <xsl:if test="position() != last()">
- <xsl:text>;</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="ns:is_primary =true">
- <xsl:value-of select="(ns:phone_number)"/>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="ns:is_primary =false">
- <xsl:value-of select="(ns:phone_number)"/>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- <xsl:text> </xsl:text></xsl:for-each>
- </xsl:for-each></xsl:template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement