Skip to main content
added 495 characters in body
Source Link
michael.hor257k
  • 117.6k
  • 6
  • 36
  • 55

Not sure why you need to build a map (or why, if you're going to build a map, you are populating it with XML snippets)when when you can do simply:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/wd:Email" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected]
[email protected]

or:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/(wd:Email||' '||wd:Mobile)" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected] 987456
[email protected] 5478253

directly from the input XML.


Note that if your map were constructed as a map, say:

map {'entries': 
    [ 
    map {
        'Worker_ID': '001',
        'Email': '[email protected]',
        'Telephone':'123456', 
        'Mobile':'987456' 
        }, 
    map {
        'Worker_ID': '001',
        'Email': '[email protected]',
        'Telephone':'578963', 
        'Mobile':'5478253' 
        }
    ]
}

you could use:

<xsl:value-of select="$reportMap?entries?*?Email" separator="&#10;"/>

to get:

[email protected]
[email protected]

Not sure why you need to build a map (or why, if you're going to build a map, you are populating it with XML snippets)when you can do simply:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/wd:Email" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected]
[email protected]

or:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/(wd:Email||' '||wd:Mobile)" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected] 987456
[email protected] 5478253

directly from the input XML.

Not sure why you need to build a map (or why, if you're going to build a map, you are populating it with XML snippets) when you can do simply:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/wd:Email" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected]
[email protected]

or:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/(wd:Email||' '||wd:Mobile)" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected] 987456
[email protected] 5478253

directly from the input XML.


Note that if your map were constructed as a map, say:

map {'entries': 
    [ 
    map {
        'Worker_ID': '001',
        'Email': '[email protected]',
        'Telephone':'123456', 
        'Mobile':'987456' 
        }, 
    map {
        'Worker_ID': '001',
        'Email': '[email protected]',
        'Telephone':'578963', 
        'Mobile':'5478253' 
        }
    ]
}

you could use:

<xsl:value-of select="$reportMap?entries?*?Email" separator="&#10;"/>

to get:

[email protected]
[email protected]
Source Link
michael.hor257k
  • 117.6k
  • 6
  • 36
  • 55

Not sure why you need to build a map (or why, if you're going to build a map, you are populating it with XML snippets)when you can do simply:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/wd:Email" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected]
[email protected]

or:

<xsl:stylesheet version="3.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wd="urn:com.workday.report/myreport">
<xsl:output method="text"/>

<xsl:template match="/AggregatedData">
    <xsl:value-of select="wd:Report_Data/wd:Report_Entry/(wd:Email||' '||wd:Mobile)" separator="&#10;"/>
</xsl:template>

</xsl:stylesheet>

to get:

[email protected] 987456
[email protected] 5478253

directly from the input XML.