• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

Transpose XML file into table

Is there a way to transpose the XML data attached into a table with column names?

in the snippet attached everything would repeat the same down to the availability info, and the availability info can repeat itself x times

so if there were 3 "sets" of availability info...
resortID through privacyOccupancy would always be the first 7 columns and would repeat for 3 records with inventoryType through unitCount being different for the three records.

            <resortName>Sheraton Vistana Resort</resortName>
            <kitchenType>Full Kitchen</kitchenType>

Open in new window

  • 2
  • 2
1 Solution
Melih SARICAIT ManagerCommented:
try this One.. It gives Idea
<?xml version="1.0" encoding="ISO-8859-9"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method = "xml" /> 
<xsl:template match = "/" > 
<xsl:for-each select = "/accommodationItem" >
<table cellspacing="5" cellpadding="2" style="border:1px solid #cccccc;width:250px" >
<tr ><td ><xsl:value-of select ="./resortName" /></td></tr>
<tr style="font-size:11px">
<td   >
	Number of Bedrooms : <xsl:value-of select ="./nbrOfBedrooms" />
	Number of BathRooms: <xsl:value-of select ="./nbrOfBathrooms" />
	Kitchen Type: <xsl:value-of select ="./kitchenType" />
<xsl:for-each select = "./availabilityInfo" >
<tr style="font-size:11px">
<td >
        CheckIn : <xsl:value-of select ="./checkInDate" />
	CheckOut: <xsl:value-of select ="./checkOutDate" />
	Cost: <xsl:value-of select ="./unitCost/value" /><xsl:value-of select ="./unitCost/currency" />

Open in new window

lrbristerAuthor Commented:

Is there a way to place that in a dataset?
lrbristerAuthor Commented:
And how do I use it?
Melih SARICAIT ManagerCommented:
What i send is for transform.. U  can use it with xmltransform...

Using it as dataset is something as different..
create a new dataset and use readXML function to read into dataset .. there are some parameters about schema try different values for desired result..

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now