4.1 XML vs simple procedure
Posted: Sat Nov 10, 2007 9:47 pm
Hi everybody. I have began working on an application for posting items on eBay (probably the only one written in PB -- will definitely be the fastest!).
I have figured out the communication aspect and eBay returns an XML file with each query to their server. I have written a very simple XML parsing procedure so should I switch to the PB one? Any ideas on speed, reliability, etc..?
Basically grabs data between the <tags>:
I have figured out the communication aspect and eBay returns an XML file with each query to their server. I have written a very simple XML parsing procedure so should I switch to the PB one? Any ideas on speed, reliability, etc..?
Basically grabs data between the <tags>:
Code: Select all
Procedure.s GetXMLData(XMLTag$, String$)
XMLTag_Open$ = "<" + XMLTag$ + ">"
XMLTag_Close$ = "</" + XMLTag$ + ">"
XMLTag_StartPosition = findstring(String$, XMLTag_Open$, 1)
XMLTag_Open_Length = len(XMLTag_Open$)
XMLTag_Open_EndPoint = XMLTag_StartPosition + XMLTag_Open_Length
XMLTag_Close_StartPosition = findstring(String$, XMLTag_Close$, XMLTag_StartPosition)
ReturnData_Length = XMLTag_Close_StartPosition - XMLTag_Open_EndPoint
ReturnData$ = mid(String$, XMLTag_Open_EndPoint, ReturnData_Length)
ProcedureReturn ReturnData$
EndProcedure