p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

vb_xml thread: group records from a xml file-->>3 question


Message #1 by "yeong" <hkyeong1@y...> on Fri, 7 Feb 2003 08:51:47
hi all

my question  about xslt and xml
are below:

q1)

I have the following xml file:
(a1.xml)

<?xml version="1.0" ?> 
<external_links>	
<link>
	<site_name>site1</site_name>
	<category_name>Category 1</category_name>
</link>
<link>
	<site_name>site2</site_name>
	<category_name>Category 2</category_name>
</link>
<link>
	<site_name>site3</site_name>
	<category_name>Category 1</category_name>
</link>
<link>
	<site_name>site4</site_name>
	<category_name>Category 2</category_name>
</link>
</external_links>	


I have the following xsl file:
(t1.xsl)

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">

<xsl:key name="links-by-category" match="link" use="category_name" />

<xsl:template match="external_links">
	<xsl:for-each select="//link[count(. | key('links-by-category',
category_name)[1]) = 1]">
		<xsl:sort select="category_name" />
		<xsl:value-of select="category_name" /><br />
		<xsl:for-each select="key('links-by-category',
category_name)">
			<xsl:sort select="site_name" />
			<xsl:value-of select="site_name" /> <br />
		</xsl:for-each>
	</xsl:for-each>

<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>


in vb code

Private Sub Command7_Click()
Set source1 = CreateObject("microsoft.xmldom")
source1.async = False
source1.Load (App.Path & "\a1.xml")


Set dynstyle = CreateObject("microsoft.xmldom")
dynstyle.async = False
dynstyle.Load (App.Path & "\t1.xsl")
MsgBox dynstyle.parseError.errorCode

q = source1.transformNode(dynstyle)
'MsgBox q

szfile = App.Path & "\sample.xml"
Set ofso = CreateObject("Scripting.FileSystemObject")
Set ofile = ofso.OpenTextFile(szfile, 2)
ofile.write (q)
ofile.Close

'MsgBox "done22"


End Sub


my question 

1)why the sample.xml file
is alway come out same as t1.xsl

2)cannot get the format in sample.xml like

Expected out:

Category 1
-----------
site1
site3

Category 2
-----------
site2
site4


**in xml format??

thank for advance


q2)
I have the following xml file:
(rm1.xml)

<sample>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90371-3</pono>
<c4>AK90371-3</c4>
<invoiceno>8300012518</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000001</itemno>
<modelno>CU-A24BBP5-2</modelno>
<quantity>6</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,750.76</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>175401</creationtime>
<c26>000001</c26>
<c27>CU-A24BBP5-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90371-3</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90371-3</pono>
<c4>AK90371-3</c4>
<invoiceno>8300012518</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000002</itemno>
<modelno>CU-A28BBP5-2</modelno>
<quantity>13</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,872.55</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>175401</creationtime>
<c26>000002</c26>
<c27>CU-A28BBP5-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90371-3</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90371-3</pono>
<c4>AK90371-3</c4>
<invoiceno>8300012518</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000003</itemno>
<modelno>CU-A28BBP8-2</modelno>
<quantity>5</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,872.55</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>175401</creationtime>
<c26>000003</c26>
<c27>CU-A28BBP8-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90371-3</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90372-3</pono>
<c4>AK90372-3</c4>
<invoiceno>8300012519</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000001</itemno>
<modelno>CS-A28BB4P-2</modelno>
<quantity>3</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>923.83</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>175820</creationtime>
<c26>000001</c26>
<c27>CS-A28BB4P-2</c27>
<modelname>INDOOR UNIT H</modelname>
<c29>AK90372-3</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90372-3</pono>
<c4>AK90372-3</c4>
<invoiceno>8300012519</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000002</itemno>
<modelno>CS-A50BTP-2</modelno>
<quantity>1</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,907.49</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>175820</creationtime>
<c26>000002</c26>
<c27>CS-A50BTP-2</c27>
<modelname>INDOOR UNIT H</modelname>
<c29>AK90372-3</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90373-2</pono>
<c4>AK90373-2</c4>
<invoiceno>8300012514</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000001</itemno>
<modelno>CZ-BT01P</modelno>
<quantity>20</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>278.98</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>172757</creationtime>
<c26>000001</c26>
<c27>CZ-BT01P</c27>
<modelname>OPTIONAL ACCESSORY CS</modelname>
<c29>AK90373-2</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000003</itemno>
<modelno>CS-C7BKP-2</modelno>
<quantity>10</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>350.19</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000003</c26>
<c27>CS-C7BKP-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000004</itemno>
<modelno>CS-C9BKP-2</modelno>
<quantity>20</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>371.47</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000004</c26>
<c27>CS-C9BKP-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000005</itemno>
<modelno>CS-E12BKP-2</modelno>
<quantity>20</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>637.81</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000005</c26>
<c27>CS-E12BKP-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000007</itemno>
<modelno>CS-MA125KE-2</modelno>
<quantity>2</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>502.39</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000007</c26>
<c27>CS-MA125KE-2</c27>
<modelname>AIR CONDITIONER</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000008</itemno>
<modelno>CS-MA95KE-2</modelno>
<quantity>2</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>385.13</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000008</c26>
<c27>CS-MA95KE-2</c27>
<modelname>AIR CONDITIONER</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000009</itemno>
<modelno>CS-1873KR</modelno>
<quantity>20</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>600.97</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000009</c26>
<c27>CS-1873KR</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000012</itemno>
<modelno>CU-C7BKP5-2</modelno>
<quantity>10</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>525.23</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000012</c26>
<c27>CU-C7BKP5-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000013</itemno>
<modelno>CU-C9BKP5-2</modelno>
<quantity>20</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>557.20</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000013</c26>
<c27>CU-C9BKP5-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012513</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000014</itemno>
<modelno>CU-E12BKP5-2</modelno>
<quantity>20</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>956.71</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>171825</creationtime>
<c26>000014</c26>
<c27>CU-E12BKP5-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012520</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000001</itemno>
<modelno>CS-A7BKP-2</modelno>
<quantity>30</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>380.60</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>183318</creationtime>
<c26>000001</c26>
<c27>CS-A7BKP-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012520</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000002</itemno>
<modelno>CS-A9BKP-2</modelno>
<quantity>100</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>404.96</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>183318</creationtime>
<c26>000002</c26>
<c27>CS-A9BKP-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012520</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000010</itemno>
<modelno>CU-A7BKP5-2</modelno>
<quantity>30</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>570.90</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>183318</creationtime>
<c26>000010</c26>
<c27>CU-A7BKP5-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90374-4</pono>
<c4>AK90374-4</c4>
<invoiceno>8300012520</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000011</itemno>
<modelno>CU-A9BKP5-2</modelno>
<quantity>100</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>607.44</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>183318</creationtime>
<c26>000011</c26>
<c27>CU-A9BKP5-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90374-4</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90524-3</pono>
<c4>AK90524-3</c4>
<invoiceno>8300012515</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000001</itemno>
<modelno>CU-A28BBP8-2</modelno>
<quantity>5</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,872.55</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>173315</creationtime>
<c26>000001</c26>
<c27>CU-A28BBP8-2</c27>
<modelname>AIR CONDITIONERS</modelname>
<c29>AK90524-3</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90527-2</pono>
<c4>AK90527-2</c4>
<invoiceno>8300012516</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000001</itemno>
<modelno>CS-A34BB4P-2</modelno>
<quantity>5</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,196.72</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>174818</creationtime>
<c26>000001</c26>
<c27>CS-A34BB4P-2</c27>
<modelname>INDOOR UNIT H</modelname>
<c29>AK90527-2</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90527-2</pono>
<c4>AK90527-2</c4>
<invoiceno>8300012516</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000002</itemno>
<modelno>CS-A50BB4P-2</modelno>
<quantity>5</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,869.20</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>174818</creationtime>
<c26>000002</c26>
<c27>CS-A50BB4P-2</c27>
<modelname>INDOOR UNIT H</modelname>
<c29>AK90527-2</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90532-3</pono>
<c4>AK90532-3</c4>
<invoiceno>8300012517</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000001</itemno>
<modelno>CS-A28BB4P-2</modelno>
<quantity>5</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>923.83</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>175129</creationtime>
<c26>000001</c26>
<c27>CS-A28BB4P-2</c27>
<modelname>INDOOR UNIT H</modelname>
<c29>AK90532-3</c29>
</ponoparent>
<ponoparent>
<companycode>MAIC</companycode>
<section>AC</section>
<pono>AK90532-3</pono>
<c4>AK90532-3</c4>
<invoiceno>8300012517</invoiceno>
<address2>1 CARRIBEAN DRIVE SCORESBY</address2>
<address3>VICTORIA 3179</address3>
<address4>AUSTRALIA</address4>
<itemno>000002</itemno>
<modelno>CS-A50BB4P-2</modelno>
<quantity>2</quantity>
<etd1>20020824</etd1>
<FILLER></FILLER>
<unitprice>1,869.20</unitprice>
<filler2></filler2>
<destination>Australia</destination>
<portofdischarge>MELBOURNE</portofdischarge>
<Marking1>NO MARK</Marking1>
<origin></origin>
<vessel>MOL GOLDEN WATTLE V.0017</vessel>
<creationdate>20020819</creationdate>
<creationtime>175129</creationtime>
<c26>000002</c26>
<c27>CS-A50BB4P-2</c27>
<modelname>INDOOR UNIT H</modelname>
<c29>AK90532-3</c29>
</ponoparent>
</sample>


I have the following xsl file:
(t.xsl)
<xsl:stylesheet  xmlns:xsl='http://www.w3.org/1999/XSL/Transform' 
version='1.0'>
<xsl:key name="ponoparent-by-pono" match="ponoparent" use="pono" />
<xsl:template match="sample">
	<xsl:for-each select="ponoparent[count(. | key('ponoparent-by-
pono', pono)[1]) = 1]">
		<xsl:sort select="pono" />
		<xsl:value-of select="pono" />,<br/>
		<xsl:for-each select="key('ponoparent-by-pono', pono)">
			<xsl:sort select="itemno" />
			<xsl:value-of select="itemno" /> <br/>
		</xsl:for-each>
	</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


in vb code

Private Sub Command7_Click()

Set source1 = CreateObject("microsoft.xmldom")
source1.async = False
source1.Load (App.Path & "\rm1.xml")

Set dynstyle = CreateObject("microsoft.xmldom")
dynstyle.async = False
dynstyle.Load (App.Path & "\t.xsl")
MsgBox dynstyle.parseError.errorCode

q = source1.transformNode(dynstyle)

szfile = App.Path & "\krm1.xml"
Set ofso = CreateObject("Scripting.FileSystemObject")
Set ofile = ofso.OpenTextFile(szfile, 2)
ofile.write (q)
ofile.Close


End Sub


my question 

1)why the krm1.xml file
is alway come out same as t.xsl

2)cannot get the format in krm1.xml 
group by pono ???


q3)i has one m1.xml
(which from take data from the sql server)

<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
	xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
	xmlns:rs='urn:schemas-microsoft-com:rowset'
	xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
	<s:ElementType name='row' content='eltOnly' rs:CommandTimeout='30'>
		<s:AttributeType name='companycode' rs:number='1' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='section' rs:number='2' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='pono' rs:number='3' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='consineecode' rs:number='4' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='c4' rs:name='pono' rs:number='5' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='invoiceno' rs:number='6' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='congsineecode' rs:number='7' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='address2' rs:number='8' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='address3' rs:number='9' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='address4' rs:number='10' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='itemno' rs:number='11' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='modelno' rs:number='12' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='quantity' rs:number='13' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='etd1' rs:number='14' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='FILLER' rs:number='15' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='unitprice' rs:number='16' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='filler2' rs:number='17' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='tarriffcode' rs:number='18' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='destination' rs:number='19' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='portofdischarge' rs:number='20' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='Marking1' rs:number='21' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='origin' rs:number='22' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='tariffcode' rs:number='23' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='vessel' rs:number='24' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='creationdate' rs:number='25' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='creationtime' rs:number='26' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='c26' rs:name='itemno' 
rs:number='27' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='c27' rs:name='modelno' 
rs:number='28' rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='modelname' rs:number='29' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:AttributeType name='c29' rs:name='pono' rs:number='30' 
rs:nullable='true' rs:writeunknown='true'>
			<s:datatype dt:type='string' dt:maxLength='50'/>
		</s:AttributeType>
		<s:extends type='rs:rowbase'/>
	</s:ElementType>
</s:Schema>
<rs:data>
	<z:row companycode='MAIC' section='AC' pono='AK90371-3           ' 
c4='AK90371-3           ' invoiceno='8300012518'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000001' modelno='CU-A24BBP5-2      ' 
quantity='           6' etd1='20020824' FILLER=' ' unitprice='      
1,750.76'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='175401'
		 c26='000001' c27='CU-A24BBP5-2      ' modelname='AIR 
CONDITIONERS              ' c29='AK90371-3           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90371-3           ' 
c4='AK90371-3           ' invoiceno='8300012518'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000002' modelno='CU-A28BBP5-2      ' 
quantity='          13' etd1='20020824' FILLER=' ' unitprice='      
1,872.55'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='175401'
		 c26='000002' c27='CU-A28BBP5-2      ' modelname='AIR 
CONDITIONERS              ' c29='AK90371-3           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90371-3           ' 
c4='AK90371-3           ' invoiceno='8300012518'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000003' modelno='CU-A28BBP8-2      ' 
quantity='           5' etd1='20020824' FILLER=' ' unitprice='      
1,872.55'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='175401'
		 c26='000003' c27='CU-A28BBP8-2      ' modelname='AIR 
CONDITIONERS              ' c29='AK90371-3           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90372-3           ' 
c4='AK90372-3           ' invoiceno='8300012519'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000001' modelno='CS-A28BB4P-2      ' 
quantity='           3' etd1='20020824' FILLER=' ' unitprice='        
923.83'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='175820'
		 c26='000001' c27='CS-A28BB4P-2      ' modelname='INDOOR 
UNIT H                 ' c29='AK90372-3           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90372-3           ' 
c4='AK90372-3           ' invoiceno='8300012519'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000002' modelno='CS-A50BTP-2       ' 
quantity='           1' etd1='20020824' FILLER=' ' unitprice='      
1,907.49'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='175820'
		 c26='000002' c27='CS-A50BTP-2       ' modelname='INDOOR 
UNIT H                 ' c29='AK90372-3           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90373-2           ' 
c4='AK90373-2           ' invoiceno='8300012514'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000001' modelno='CZ-BT01P          ' 
quantity='          20' etd1='20020824' FILLER=' ' unitprice='        
278.98'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='172757'
		 c26='000001' c27='CZ-BT01P          ' modelname='OPTIONAL 
ACCESSORY CS         ' c29='AK90373-2           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000003' modelno='CS-C7BKP-2        ' 
quantity='          10' etd1='20020824' FILLER=' ' unitprice='        
350.19'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000003' c27='CS-C7BKP-2        ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000004' modelno='CS-C9BKP-2        ' 
quantity='          20' etd1='20020824' FILLER=' ' unitprice='        
371.47'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000004' c27='CS-C9BKP-2        ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000005' modelno='CS-E12BKP-2       ' 
quantity='          20' etd1='20020824' FILLER=' ' unitprice='        
637.81'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000005' c27='CS-E12BKP-2       ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000007' modelno='CS-MA125KE-2      ' 
quantity='           2' etd1='20020824' FILLER=' ' unitprice='        
502.39'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000007' c27='CS-MA125KE-2      ' modelname='AIR 
CONDITIONER               ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000008' modelno='CS-MA95KE-2       ' 
quantity='           2' etd1='20020824' FILLER=' ' unitprice='        
385.13'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000008' c27='CS-MA95KE-2       ' modelname='AIR 
CONDITIONER               ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000009' modelno='CS-1873KR         ' 
quantity='          20' etd1='20020824' FILLER=' ' unitprice='        
600.97'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000009' c27='CS-1873KR         ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000012' modelno='CU-C7BKP5-2       ' 
quantity='          10' etd1='20020824' FILLER=' ' unitprice='        
525.23'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000012' c27='CU-C7BKP5-2       ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000013' modelno='CU-C9BKP5-2       ' 
quantity='          20' etd1='20020824' FILLER=' ' unitprice='        
557.20'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000013' c27='CU-C9BKP5-2       ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012513'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000014' modelno='CU-E12BKP5-2      ' 
quantity='          20' etd1='20020824' FILLER=' ' unitprice='        
956.71'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='171825'
		 c26='000014' c27='CU-E12BKP5-2      ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012520'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000001' modelno='CS-A7BKP-2        ' 
quantity='          30' etd1='20020824' FILLER=' ' unitprice='        
380.60'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='183318'
		 c26='000001' c27='CS-A7BKP-2        ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012520'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000002' modelno='CS-A9BKP-2        ' 
quantity='         100' etd1='20020824' FILLER=' ' unitprice='        
404.96'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='183318'
		 c26='000002' c27='CS-A9BKP-2        ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012520'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000010' modelno='CU-A7BKP5-2       ' 
quantity='          30' etd1='20020824' FILLER=' ' unitprice='        
570.90'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='183318'
		 c26='000010' c27='CU-A7BKP5-2       ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90374-4           ' 
c4='AK90374-4           ' invoiceno='8300012520'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000011' modelno='CU-A9BKP5-2       ' 
quantity='         100' etd1='20020824' FILLER=' ' unitprice='        
607.44'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='183318'
		 c26='000011' c27='CU-A9BKP5-2       ' modelname='AIR 
CONDITIONERS              ' c29='AK90374-4           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90524-3           ' 
c4='AK90524-3           ' invoiceno='8300012515'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000001' modelno='CU-A28BBP8-2      ' 
quantity='           5' etd1='20020824' FILLER=' ' unitprice='      
1,872.55'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='173315'
		 c26='000001' c27='CU-A28BBP8-2      ' modelname='AIR 
CONDITIONERS              ' c29='AK90524-3           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90527-2           ' 
c4='AK90527-2           ' invoiceno='8300012516'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000001' modelno='CS-A34BB4P-2      ' 
quantity='           5' etd1='20020824' FILLER=' ' unitprice='      
1,196.72'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='174818'
		 c26='000001' c27='CS-A34BB4P-2      ' modelname='INDOOR 
UNIT H                 ' c29='AK90527-2           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90527-2           ' 
c4='AK90527-2           ' invoiceno='8300012516'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000002' modelno='CS-A50BB4P-2      ' 
quantity='           5' etd1='20020824' FILLER=' ' unitprice='      
1,869.20'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='174818'
		 c26='000002' c27='CS-A50BB4P-2      ' modelname='INDOOR 
UNIT H                 ' c29='AK90527-2           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90532-3           ' 
c4='AK90532-3           ' invoiceno='8300012517'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000001' modelno='CS-A28BB4P-2      ' 
quantity='           5' etd1='20020824' FILLER=' ' unitprice='        
923.83'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='175129'
		 c26='000001' c27='CS-A28BB4P-2      ' modelname='INDOOR 
UNIT H                 ' c29='AK90532-3           '/>
	<z:row companycode='MAIC' section='AC' pono='AK90532-3           ' 
c4='AK90532-3           ' invoiceno='8300012517'
		 address2='1 CARRIBEAN DRIVE SCORESBY              ' 
address3='VICTORIA 3179                           ' 
address4='AUSTRALIA                               '
		 itemno='000002' modelno='CS-A50BB4P-2      ' 
quantity='           2' etd1='20020824' FILLER=' ' unitprice='      
1,869.20'
		 filler2=' ' destination='Australia           ' 
portofdischarge='MELBOURNE                     ' Marking1='NO 
MARK                       '
		 origin='               ' vessel='MOL GOLDEN WATTLE 
V.0017      ' creationdate='20020819' creationtime='175129'
		 c26='000002' c27='CS-A50BB4P-2      ' modelname='INDOOR 
UNIT H                 ' c29='AK90532-3           '/>
</rs:data>
</xml>

i also has convert.xsl --xsl file

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/TR/WD-xsl'>
<xsl:template match='/'>
<sample>
  <xsl:for-each select='xml/rs:data/z:row'>
  <ponoparent>
    <xsl:for-each select='@*'>
      <xsl:element><xsl:value-of select='.'/></xsl:element>
    </xsl:for-each>
    <xsl:for-each select='*'>
      <xsl:element><xsl:value-of select='.'/>
        <xsl:for-each select='@*'>
          <xsl:element><xsl:value-of select='.'/></xsl:element>
        </xsl:for-each>
      </xsl:element>
    </xsl:for-each>
  </ponoparent>
  </xsl:for-each>
</sample>
</xsl:template>
</xsl:stylesheet>


in vb code


Dim source
Dim dynstyle
Dim p
Set source = CreateObject("microsoft.xmldom")
source.async = False
source.Load (App.Path & "\m1.xml")


MsgBox source.parseError.errorCode
Set dynstyle = CreateObject("microsoft.xmldom")
dynstyle.async = False
dynstyle.Load (App.Path & "\convert.xsl")
MsgBox dynstyle.parseError.errorCode

p = source.transformNode(dynstyle)
MsgBox p
Dim szfile
Dim ofso
Dim ofile
szfile = App.Path & "\rm1.xml"
Set ofso = CreateObject("Scripting.FileSystemObject")
Set ofile = ofso.OpenTextFile(szfile, 2)
ofile.write (p)
ofile.Close

MsgBox "done"

my question 

a)how i can direct convert the m1.xml
to krm1.xml (see q 2)
(no need to rm1.xml then to krm1.xml ??)
it is possible??

the krm1.xml has format
group by pono  

**i mean can it be m1.xml direct to krm1.xml format?

or i must convert to rm1.xml then using another xsl file in q2 to convert 
to krm1.xml format?


please help.


thank a lot

regard,
yeong



  Return to Index