xsl-list
[Top] [All Lists]

Re: [xsl] Creating list using xslt

2014-11-19 15:14:56
<xsl:template match="Employee">
                <ArrayOfstringVariable
xmlns="http://schemas.abc.org/2004/07/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
                        <xsl:for-each select="*">
                                <stringVariable>
                                        <name>
                                                <xsl:value-of select="name()"/>
                                        </name>
                                        <value>
                                                <xsl:value-of select="."/>
                                        </value>
                                </stringVariable>
                        </xsl:for-each>
                </ArrayOfstringVariable>
        </xsl:template>

On 19 November 2014 15:39, jaya k jayak_36(_at_)yahoo(_dot_)com
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
Hi All,


I have below xml

<?xml version="1.0" encoding="UTF-8"?>
<Employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >
<FirstName>John</FirstName>
<LastName>Peter</LastName>
<Initial>T</Initial>
</Employee>

I want to write an xslt to output below xml from the xml above, can anyone
help to me write this xslt?

<?xml version="1.0" encoding="UTF-8"?>
<ArrayOfstringVariable xmlns="http://schemas.abc.org/2004/07/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
<stringVariable>
<name>FirstName</name>
<value>John</value>
</stringVariable>
<stringVariable>
<name>LastName</name>
<value>Peter</value>
</stringVariable>
<stringVariable>
<name>Initial</name>
<value>T</value>
</stringVariable>
</ArrayOfstringVariable>
Thanks in advance

XSL-List info and archive
EasyUnsubscribe (by email)



-- 
Vasu Chakkera
NodeLogic Limited
Oxford
www.node-logic.com
==============
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [xsl] Creating list using xslt, Vasu Chakkera vasucv(_at_)gmail(_dot_)com <=