Page 1 of 1

Howto convert text to XML

Posted: Fri Jun 27, 2014 11:34 am
by karu
Can anyone help, i got through the websocket xml file in text format. Now if i want to parse XML, i need to convert this text value to SB XML. How to do this?

thanks
Karu

Re: Howto convert text to XML

Posted: Fri Jun 27, 2014 6:26 pm
by Peter
you can do this with CatchXML().

Greetings ... Peter

Re: Howto convert text to XML

Posted: Fri Jun 27, 2014 7:40 pm
by karu
Peter wrote:you can do this with CatchXML().

Greetings ... Peter
Thanks Peter, but with CatchXML() i get: ReferenceError: spider_CatchXML is not defined

Re: Howto convert text to XML

Posted: Sun Jun 29, 2014 9:26 pm
by Cool Dji
Hello Karu,

Is your first need is to read a texte file with data (without the "openfile" function) ?

Do you try to do this with the xml file ?

If you want to work only with xml file, i can't help you...but if you want to read data with a file, i can help you : i write data on a .raw file, and i transform it (with photoshop) on a .bmp file
If you want, i can put a real example but at first here is the code to read data on a .bmp file...

Code: Select all

 StartDrawing(ImageOutput(0))
      ri(c,l)
      nbmapdalle = t
      StopDrawing()



Procedure ri(x.i,y.i)
   cl=Point(x,y)
   n0=Str(Red(cl))
   n1=Str(Green(cl))
   n2=Str(Blue(cl))
   sr=""
   w=Len(Bin(Val(n2)))
   If w<8
   For q=0 To 8-w-1
   sr=sr+"0"  
   Next
   EndIf
   si=Bin(Val(n1))+sr+Bin(Val(n2))
   t=Val("%"+si)
   If n0="1":t=-t:EndIf
   c+1
 EndProcedure