Hi all, I need your help.
I try this ASP code for convert file xml to txt.
<%
'----------
Dim xmlSource
Dim xmlXForm
Dim strErr
Dim strResult
Dim fso , file
Dim strPath
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Set xmlSource = CreateObject("MSXML2.DOMDocument.4.0")
Set xmlXForm = CreateObject("MSXML2.DOMDocument.4.0")
xmlSource.validateOnParse = True
xmlXForm.validateOnParse = True
xmlSource.async = False
xmlXForm.async = False
xmlSource.Load Server.Mappath("\\xml\ itty.xml")
xmlXForm.Load Server.Mappath("\\xml\ estme.xsl")
strResult = xmlSource.transformNode(xmlXForm)
Set fso = CreateObject("Scripting.FileSystemObject")
strPath = Server.Mappath("\\xml\ estme.txt")
Set file = fso.opentextfile(strPath, ForWriting, True)
file.write strResult
file.Close
Set file = Nothing
Set fso = Nothing
Set xmlSource = Nothing
Set xmlXForm = Nothing
'----------
%>
But I have problem, this is the output in the txt file:
4150"
12.19.27.15"
mike"
ON"
ON"
mike"
20w97m1"
244E4119C5254BB5D184"
1"
13222"
0"
0"
I need this output:
4150;12.19.27.15;mike;ON;ON;mike;20w97m1;244E4119C5254BB5D184;1;13222;0;0
One row for one record of the table mysql. It’s possible?
This is the testme.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
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">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:for-each select="/xml/rs:data/z:row">
<xsl:for-each select="@*">
<xsl:value-of select="."/>"
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Can you help me?
Thanks a lot.
CM