How to get repeating element in XSLT 2.0



I want to get the repeating "Author" element in the following XML structure against each product. How will i do it? I am using the following online tool for testing http://ift.tt/1boT3PS


XML



<OrderDocument>
<OrderProduct>
<Product>
<ProductDescription>ProductDescription</ProductDescription>
<Author>Author</Author>
<Author>Author</Author>
</Product>
</OrderProduct>
<OrderProduct>
<Product>
<ProductDescription>ProductDescription</ProductDescription>
<Author>Author</Author>
<Author>Author</Author>
</Product>
</OrderProduct>
<OrderProduct>
<Product>
<ProductDescription>ProductDescription</ProductDescription>
<Author>Author</Author>
<Author>Author</Author>
</Product>
</OrderProduct>
</OrderDocument>


XSLT File:



<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://ift.tt/tCZ8VR" version="1.0">
<xsl:template match="//OrderDocument">


</xsl:template>
</xsl:stylesheet>


Output Required:



<Message>
<Product>
<Author>Author</Author>
<Author>Author</Author>
</Product>
<Product>
<Author>Author</Author>
<Author>Author</Author>
</Product>
</Message>

No comments:

Post a Comment