Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

XML to XML using XSLT

$
0
0

Hi

 I have a XML script which includes inline schema values. I need to convert into to proper XL data. 

Available Code,

<?xml version="1.0" encoding="UTF-16"?>

-<DataSet>


-<xs:schema xmlns:app2="urn:schemas-microsoft-com:sql:SqlRowSet1" xmlns:app1="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:sql:SqlDataSet" xmlns:mstns="urn:schemas-microsoft-com:sql:SqlDataSet" targetNamespace="urn:schemas-microsoft-com:sql:SqlDataSet" id="SqlDataSet"><xs:import namespace="urn:schemas-microsoft-com:sql:SqlRowSet1"/><xs:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes"/>


-<xs:element msdata:UseCurrentLocale="true" msdata:IsDataSet="true" name="SqlDataSet">


-<xs:complexType>


-<xs:choice maxOccurs="unbounded" minOccurs="0"><xs:element ref="app2:row"/></xs:choice></xs:complexType></xs:element></xs:schema>


-<xs:schema xmlns:app2="urn:schemas-microsoft-com:sql:SqlRowSet1" xmlns:app1="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/sqlserver/2004/sqltypes" xmlns:mstns="urn:schemas-microsoft-com:sql:SqlDataSet" targetNamespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes"><xs:import namespace="urn:schemas-microsoft-com:sql:SqlRowSet1"/><xs:import namespace="urn:schemas-microsoft-com:sql:SqlDataSet"/>


-<xs:simpleType name="int"><xs:restriction base="xs:int"/></xs:simpleType>


-<xs:simpleType name="varchar"><xs:restriction base="xs:string"/></xs:simpleType>


-<xs:simpleType name="numeric"><xs:restriction base="xs:decimal"/></xs:simpleType></xs:schema>


-<xs:schema xmlns:app2="urn:schemas-microsoft-com:sql:SqlRowSet1" xmlns:app1="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" xmlns:mstns="urn:schemas-microsoft-com:sql:SqlDataSet" targetNamespace="urn:schemas-microsoft-com:sql:SqlRowSet1"><xs:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes"/><xs:import namespace="urn:schemas-microsoft-com:sql:SqlDataSet"/>


-<xs:element name="row">


-<xs:complexType>


-<xs:sequence><xs:element name="PlayerID" type="app1:int"/>


-<xs:element name="PlayerName" minOccurs="0">


-<xs:simpleType>


-<xs:restriction base="app1:varchar"><xs:maxLength value="15"/></xs:restriction></xs:simpleType></xs:element>


-<xs:element name="BelongsTo" minOccurs="0">


-<xs:simpleType>


-<xs:restriction base="app1:varchar"><xs:maxLength value="15"/></xs:restriction></xs:simpleType></xs:element><xs:element name="MatchPlayed" minOccurs="0" type="app1:int"/><xs:element name="RunsMade" minOccurs="0" type="app1:int"/><xs:element name="WicketsTaken" minOccurs="0" type="app1:int"/>


-<xs:element name="FeePerMatch" minOccurs="0" msdata:DataType="System.Data.SqlTypes.SqlDecimal">


-<xs:simpleType><xs:restriction base="app1:numeric"/></xs:simpleType></xs:element></xs:sequence></xs:complexType></xs:element></xs:schema>


-<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">


-<SqlDataSet xmlns="urn:schemas-microsoft-com:sql:SqlDataSet">


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row1" msdata:rowOrder="0"><PlayerID>1</PlayerID><PlayerName>A. Won</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>440</RunsMade><WicketsTaken>10</WicketsTaken><FeePerMatch>1000000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row2" msdata:rowOrder="1"><PlayerID>2</PlayerID><PlayerName>A. Cricket</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>50</RunsMade><WicketsTaken>17</WicketsTaken><FeePerMatch>400000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row3" msdata:rowOrder="2"><PlayerID>3</PlayerID><PlayerName>B. Dhanman</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>650</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>3600000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row4" msdata:rowOrder="3"><PlayerID>4</PlayerID><PlayerName>C. Barsat</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>950</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>5000000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row5" msdata:rowOrder="4"><PlayerID>5</PlayerID><PlayerName>A. Mirza</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>2</MatchPlayed><RunsMade>3</RunsMade><WicketsTaken>38</WicketsTaken><FeePerMatch>3600000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row6" msdata:rowOrder="5"><PlayerID>6</PlayerID><PlayerName>M. Karol</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>15</MatchPlayed><RunsMade>44</RunsMade><WicketsTaken>4</WicketsTaken><FeePerMatch>2000000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row7" msdata:rowOrder="6"><PlayerID>7</PlayerID><PlayerName>Z. Hamsa</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>3</MatchPlayed><RunsMade>580</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>400.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row8" msdata:rowOrder="7"><PlayerID>8</PlayerID><PlayerName>K. Loly</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>6</MatchPlayed><RunsMade>500</RunsMade><WicketsTaken>12</WicketsTaken><FeePerMatch>800000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row9" msdata:rowOrder="8"><PlayerID>9</PlayerID><PlayerName>S. Summer</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>87</MatchPlayed><RunsMade>50</RunsMade><WicketsTaken>8</WicketsTaken><FeePerMatch>1230000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row10" msdata:rowOrder="9"><PlayerID>10</PlayerID><PlayerName>J.June</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>12</MatchPlayed><RunsMade>510</RunsMade><WicketsTaken>9</WicketsTaken><FeePerMatch>4988000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row11" msdata:rowOrder="10"><PlayerID>11</PlayerID><PlayerName>A.Namaki</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>1</MatchPlayed><RunsMade>4</RunsMade><WicketsTaken>180</WicketsTaken><FeePerMatch>999999.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row12" msdata:rowOrder="11"><PlayerID>12</PlayerID><PlayerName>Z. Samaki</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>2</MatchPlayed><RunsMade>6</RunsMade><WicketsTaken>147</WicketsTaken><FeePerMatch>888888.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row13" msdata:rowOrder="12"><PlayerID>13</PlayerID><PlayerName>MS. Kaki</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>40</MatchPlayed><RunsMade>66</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>1234.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row14" msdata:rowOrder="13"><PlayerID>14</PlayerID><PlayerName>S. Boon</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>170</MatchPlayed><RunsMade>888</RunsMade><WicketsTaken>10</WicketsTaken><FeePerMatch>890.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row15" msdata:rowOrder="14"><PlayerID>15</PlayerID><PlayerName>DC. Shane</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>28</MatchPlayed><RunsMade>39</RunsMade><WicketsTaken>338</WicketsTaken><FeePerMatch>4444499.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row16" msdata:rowOrder="15"><PlayerID>16</PlayerID><PlayerName>S. Noami</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>165</MatchPlayed><RunsMade>484</RunsMade><WicketsTaken>45</WicketsTaken><FeePerMatch>5678.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row17" msdata:rowOrder="16"><PlayerID>17</PlayerID><PlayerName>Z. Biswas</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>73</MatchPlayed><RunsMade>51</RunsMade><WicketsTaken>50</WicketsTaken><FeePerMatch>22222.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row18" msdata:rowOrder="17"><PlayerID>18</PlayerID><PlayerName>K. Dolly</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>65</MatchPlayed><RunsMade>59</RunsMade><WicketsTaken>1</WicketsTaken><FeePerMatch>99999.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row19" msdata:rowOrder="18"><PlayerID>19</PlayerID><PlayerName>S. Winter</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>7</MatchPlayed><RunsMade>50</RunsMade><WicketsTaken>8</WicketsTaken><FeePerMatch>12.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row20" msdata:rowOrder="19"><PlayerID>20</PlayerID><PlayerName>J.August</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>9</MatchPlayed><RunsMade>99</RunsMade><WicketsTaken>98</WicketsTaken><FeePerMatch>890.00</FeePerMatch></row></SqlDataSet></diffgr:diffgram></DataSet>

I need to get like below for that what XSLT, i should use?

-<SqlDataSet xmlns="urn:schemas-microsoft-com:sql:SqlDataSet">


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row1" msdata:rowOrder="0"><PlayerID>1</PlayerID><PlayerName>A. Won</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>440</RunsMade><WicketsTaken>10</WicketsTaken><FeePerMatch>1000000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row2" msdata:rowOrder="1"><PlayerID>2</PlayerID><PlayerName>A. Cricket</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>50</RunsMade><WicketsTaken>17</WicketsTaken><FeePerMatch>400000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row3" msdata:rowOrder="2"><PlayerID>3</PlayerID><PlayerName>B. Dhanman</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>650</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>3600000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row4" msdata:rowOrder="3"><PlayerID>4</PlayerID><PlayerName>C. Barsat</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>10</MatchPlayed><RunsMade>950</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>5000000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row5" msdata:rowOrder="4"><PlayerID>5</PlayerID><PlayerName>A. Mirza</PlayerName><BelongsTo>India</BelongsTo><MatchPlayed>2</MatchPlayed><RunsMade>3</RunsMade><WicketsTaken>38</WicketsTaken><FeePerMatch>3600000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row6" msdata:rowOrder="5"><PlayerID>6</PlayerID><PlayerName>M. Karol</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>15</MatchPlayed><RunsMade>44</RunsMade><WicketsTaken>4</WicketsTaken><FeePerMatch>2000000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row7" msdata:rowOrder="6"><PlayerID>7</PlayerID><PlayerName>Z. Hamsa</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>3</MatchPlayed><RunsMade>580</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>400.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row8" msdata:rowOrder="7"><PlayerID>8</PlayerID><PlayerName>K. Loly</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>6</MatchPlayed><RunsMade>500</RunsMade><WicketsTaken>12</WicketsTaken><FeePerMatch>800000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row9" msdata:rowOrder="8"><PlayerID>9</PlayerID><PlayerName>S. Summer</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>87</MatchPlayed><RunsMade>50</RunsMade><WicketsTaken>8</WicketsTaken><FeePerMatch>1230000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row10" msdata:rowOrder="9"><PlayerID>10</PlayerID><PlayerName>J.June</PlayerName><BelongsTo>US</BelongsTo><MatchPlayed>12</MatchPlayed><RunsMade>510</RunsMade><WicketsTaken>9</WicketsTaken><FeePerMatch>4988000.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row11" msdata:rowOrder="10"><PlayerID>11</PlayerID><PlayerName>A.Namaki</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>1</MatchPlayed><RunsMade>4</RunsMade><WicketsTaken>180</WicketsTaken><FeePerMatch>999999.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row12" msdata:rowOrder="11"><PlayerID>12</PlayerID><PlayerName>Z. Samaki</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>2</MatchPlayed><RunsMade>6</RunsMade><WicketsTaken>147</WicketsTaken><FeePerMatch>888888.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row13" msdata:rowOrder="12"><PlayerID>13</PlayerID><PlayerName>MS. Kaki</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>40</MatchPlayed><RunsMade>66</RunsMade><WicketsTaken>0</WicketsTaken><FeePerMatch>1234.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row14" msdata:rowOrder="13"><PlayerID>14</PlayerID><PlayerName>S. Boon</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>170</MatchPlayed><RunsMade>888</RunsMade><WicketsTaken>10</WicketsTaken><FeePerMatch>890.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row15" msdata:rowOrder="14"><PlayerID>15</PlayerID><PlayerName>DC. Shane</PlayerName><BelongsTo>Australia</BelongsTo><MatchPlayed>28</MatchPlayed><RunsMade>39</RunsMade><WicketsTaken>338</WicketsTaken><FeePerMatch>4444499.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row16" msdata:rowOrder="15"><PlayerID>16</PlayerID><PlayerName>S. Noami</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>165</MatchPlayed><RunsMade>484</RunsMade><WicketsTaken>45</WicketsTaken><FeePerMatch>5678.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row17" msdata:rowOrder="16"><PlayerID>17</PlayerID><PlayerName>Z. Biswas</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>73</MatchPlayed><RunsMade>51</RunsMade><WicketsTaken>50</WicketsTaken><FeePerMatch>22222.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row18" msdata:rowOrder="17"><PlayerID>18</PlayerID><PlayerName>K. Dolly</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>65</MatchPlayed><RunsMade>59</RunsMade><WicketsTaken>1</WicketsTaken><FeePerMatch>99999.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row19" msdata:rowOrder="18"><PlayerID>19</PlayerID><PlayerName>S. Winter</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>7</MatchPlayed><RunsMade>50</RunsMade><WicketsTaken>8</WicketsTaken><FeePerMatch>12.00</FeePerMatch></row>


-<row xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1" diffgr:id="row20" msdata:rowOrder="19"><PlayerID>20</PlayerID><PlayerName>J.August</PlayerName><BelongsTo>Singapore</BelongsTo><MatchPlayed>9</MatchPlayed><RunsMade>99</RunsMade><WicketsTaken>98</WicketsTaken><FeePerMatch>890.00</FeePerMatch></row></SqlDataSet>

Thanks

 


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>