473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

WebService output > Tab-separated text?

Hi all,

I'm receiving output from a webservice formatted as follows:

<?xml version="1.0" encoding="utf-8"?>
<DataSet xmlns="http://tempuri.org/adrloc/levering">
<xs:schema id="Bridgis_DataSet" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
microsoft-com:xml-msdata">
<xs:element name="Bridgis_DataSet" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="Bridgis_DataTable">
<xs:complexType>
<xs:sequence>
<xs:element name="PSTK" type="xs:string" minOccurs="0" />
<xs:element name="STRAAT_NEN" type="xs:string"
minOccurs="0" />
<xs:element name="STRAAT_PTT" type="xs:string"
minOccurs="0" />
<xs:element name="STRAAT_OFF" type="xs:string"
minOccurs="0" />
<xs:element name="HUISNUMMER" type="xs:decimal"
minOccurs="0" />
<xs:element name="TOEVOEGING" type="xs:string"
minOccurs="0" />
<xs:element name="PERCEELCOD" type="xs:string"
minOccurs="0" />
<xs:element name="PLAATS_NEN" type="xs:string"
minOccurs="0" />
<xs:element name="PLAATS_PTT" type="xs:string"
minOccurs="0" />
<xs:element name="GEMEENTE" type="xs:string"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</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">
<Bridgis_DataSet xmlns="">
<Bridgis_DataTable diffgr:id="Bridgis_DataTable1"
msdata:rowOrder="0" diffgr:hasChanges="inserted">
<PSTK>3544AA</PSTK>
<STRAAT_NEN>Zandweg </STRAAT_NEN>
<STRAAT_PTT>ZANDWG </STRAAT_PTT>
<STRAAT_OFF>Zandweg
</STRAAT_OFF>
<HUISNUMMER>10</HUISNUMMER>
<TOEVOEGING> </TOEVOEGING>
<PERCEELCOD>T</PERCEELCOD>
<PLAATS_NEN>UTRECHT </PLAATS_NEN>
<PLAATS_PTT>UTRECHT </PLAATS_PTT>
<GEMEENTE>UTRECHT </GEMEENTE>
</Bridgis_DataTable>
<Bridgis_DataTable diffgr:id="Bridgis_DataTable2"
msdata:rowOrder="1" diffgr:hasChanges="inserted">
<PSTK>3544AA</PSTK>
<STRAAT_NEN>Zandweg </STRAAT_NEN>
<STRAAT_PTT>ZANDWG </STRAAT_PTT>
<STRAAT_OFF>Zandweg
</STRAAT_OFF>
<HUISNUMMER>9</HUISNUMMER>
<TOEVOEGING> </TOEVOEGING>
<PERCEELCOD>T</PERCEELCOD>
<PLAATS_NEN>UTRECHT </PLAATS_NEN>
<PLAATS_PTT>UTRECHT </PLAATS_PTT>
<GEMEENTE>UTRECHT </GEMEENTE>
</Bridgis_DataTable>
</Bridgis_DataSet>
</diffgr:diffgram>
</DataSet>

The number of records can be very large. I need to transform this to a tab-
separated text file within an ASP script. At the moment I go about this as
follows (all code below is JScript):

---CODE---
strXML=String(rsXML(0));
oXMLDOM.loadXML(strXML);
oDatanodes=oXMLDOM.getElementsByTagName("Bridgis_D ataTable");
strOut+=WriteRows(oDatanodes);
---END---

Where WriteRows is:

---CODE---
function WriteRows(oDataNodes) {
strOut="";
for(i=0;i<oDatanodes.length;i++) {
nRecords++;
aCh=new Array();
oDatanode=oDatanodes.item(i);
nChildren=oDatanode.childNodes.length;
for(j=0;j<nChildren;j++) {
oChild=oDatanode.childNodes.item(j);
aCh.push(oChild.text);
}
strOut+=aCh.join("\t")+"\n";
}
return strOut;
}
---END---

This is a very expensive operation which is not acceptable because the XML
recordsets i get are very large (can be up to 1,000,000 records), so I am
looking to implement a more efficient way to do this. I'm thinking about
XSLT but don't know how I would integrate this into my ASP script. Any
ideas?

Thanks,
Martijn
Jul 20 '05 #1
1 3091
> This is a very expensive operation which is not acceptable because the XML
recordsets i get are very large (can be up to 1,000,000 records), so I am
looking to implement a more efficient way to do this. I'm thinking about
XSLT but don't know how I would integrate this into my ASP script. Any
ideas?

Hi,

XSLT seems a bad idea in this case, I doubt if it would more efficient. The fastest way to do it is probably by ignoring the fact that it is XML and handling it as plain text.

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
Ceterum censeo XML omnibus esse utendum
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or...
3
by: Merav Orion via .NET 247 | last post by:
I have a problem calling webservice from client side javascript. The javascript call the settimeout() method. when the user press submit button it ignore the press and keep refreshing the page. it...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i donīt want to filter the return value of the method, i have to pass a new instance of the...
7
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
2
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
0
by: J | last post by:
I wrote a simple test webservice in .net but when I use the test page to try and run the webservice. IE does not recognize the output as an XML document, ie it doesn't automatically format the XML...
3
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net...
1
by: Pim75 | last post by:
Hello, I've written a webservice that returns an array. The output of the webservice has to be consumed by a classic asp application. As classic asp can't read the returned array I want the...
3
by: =?Utf-8?B?QkM=?= | last post by:
Hello, I just created a Hello World webservice in VB2005 (this is my first webservice ever). I ran it in debug mode and the page that came up said Hello World and said to change the webservice...
6
by: Peter | last post by:
I have a WebService which returns a List of RunningReport class How do I read this XML data on the client side. How do I convert List<RunningReportfrom the WebService side to List<RunningReporton...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.