Jump to content

Search the Community

Showing results for tags 'parse'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 3 results

  1. HI, I'm using RPC.Query to send a string from js to py. At py receptor this scrash using json.loads(..) de args. The messages error is: "" ... JSONDecoderError(\"Expecting value\", s, err.value) from None\njson.decoder.JSONDecodeEror: Expecting value: line 1 colum1 (char 0)\n", "message": "Expecting value: line 1, column 1 (char 0)"], "Exception_type":"internal_error"}}" "" I do an console.log(..) beford RPC instruction and the string value is ok. That is the code: FROM JS: .... // *JCM* var strcontenido = ''; var LF = '\n'; var orderi = JSON.parse(JSON.stringify(order)); var orderf = JSON.parse(JSON.stringify(order_flushed)); strcontenido ="80#DOCUMENTO DE PRUEBA +LF80_is*YO MISMO+LF80_ir*22157456+LF80_i03Dirección: Calle, 12345678 Ciudad, Venezuela+LF80_i04Teléfono: +584161236548+LF80_i05Referencia: 00001-317-0204+LF80_i06Mesa: M5, Comensales: 1+LF80_@*****Gracias por su compra*****+LF80_#000000010000001000Golosinas+LF101" strcontenido= strcontenido.split(":").join("?"); // Replace ":" with "?" to send to py strcontenido= strcontenido.split(",").join("-"); // Replace "," with "-" to send to py console.log(strcontenido); // This show ok errTxt = self._crear_factura( true, strcontenido); var transfer = self._flush_orders([order_flushed], {timeout:30000, to_invoice:true}); // *JCM* // ...do some... }); return done; }); return invoiced; }, // Envia comandos al programa en python- Send command to py _crear_factura: function(imprime, strcontenido) { var self = this; var ejecuted = true; strcontenido = '{"F": "\'' +strcontenido + '\'"}' // Converting string to json inserting {"id": '...string...'} format var args = JSON.parse(strcontenido); console.log('ARGS=>>'+args); // This show text ok >> 80#DOCUMENTO DE PRUEBA +LF80_is*YO MISMO+LF80_ir*22157456+LF80_i03Dirección? Calle- 12345678 Ciudad- Venezuela+LF80_i04Teléfono? +584161236548+LF80_i05Referencia? 00001-317-0204+LF80_i06Mesa? M5- Comensales? 1+LF80_@*****Gracias por su compra*****+LF80_#000000010000001000Propinas+LF101 if (imprime) { return rpc.query({ model: 'pos.order', method: 'print_ticket', args: args, }).fail(function(error, event){ ejecuted = false; }); console.log('_crear_factura (\n' + strcontenido +'\n): Ejecutada...!!!'); } else { console.log('_crear_factura (\n' + strcontenido +'\n): NO EJECUTADA...!!!'); } return ejecuted; }, ... FROM py: @api.model def print_ticket(self, strcontenido): #contenido = strcontenido.get('F') // Error: strcontenido d'nt have get method contenido = json.loads(strcontenido) // Error: previus commented f=open('c:/IntTFHKA/invoiced1.txt','w') #if strcontenido.get('F'): // Error: strcont.... # contenido = strcontenido['strcontenido'] errVal=f.write(contenido["F"]) // Never cross at this... #else: # errVal=f.write('***** GENERAR LA FACTURA*****\n\n') #for data in strcontenido: errVal=f.write(data) errVal=f.write('\n\n*****FIN DEL ARCHIVO******\\nn') errVal = f.close() return True So, I had proved some method without result.... ¿Do you have any idea to resolv...??
  2. Hi, I exported a very large xml file from a chromatography software. I want to extract the UV absorbance data (Abs vs. time). I found this node: <GilsonDADAspenSpectralData><Result><SpectralDataXML><GilsonSpectralData><SpectralData> Also: <DataInfo><DataType>Absorbance</DataType><UserUnitsYAxis>1</UserUnitsYAxis><UserUnitsYAxisLabel>Absorbance</UserUnitsYAxisLabel><CompressedData Type="Simple" FirstValue="0" SecondValue="0" Size="Small" UnCompressedByteSize="81920" CompressedByteSize="19166" PercentReduction="76.60400390625" AsciiPercentReduction="90.6416015625" > This is followed by some strange jargon (not in its entirety): Is this some type of encoded data? The node mentions it is compressed data which led me to believe I need to decode or decompress the data to obtain what I need. I attached a txt file that contains snippets of the data. I am seeking x and y values to re-plot a graph (UV absorbance plot), so I would think this node should contain such data, but it contains some strange characters. I am not knowledgeable in xml or programming in general. Please share your expertise. Thanks. *The full xml file can be downloaded here: https://drive.google.com/open?id=0B6PdLXCwSg3BbTRnamRRbDYySFk snippet.txt
  3. HiI need to parse a SOAP response xml and display come of the nodes values in an HTML page.I have tried to do this, but it doesn't work:<!DOCTYPE html><html><body><script>if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }<!--xmlhttp.open("GET","testing.xml",false);-->xmlhttp.open("POST","http://{server}/soap/services/ICDMS_PortalFormsIntegration/Processes/LC_GetDeployedFormsList?wsdl&lc_version=9.0.0&version=1.0",true);xmlhttp.send();xmlDoc=xmlhttp.responseXML;document.write("<table border='1'>");var x=xmlDoc.getElementsByTagName("FormType");for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x.getElementsByTagName("id")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x.getElementsByTagName("name")[0].childNodes[0].nodeValue); document.write("</td></tr>"); }document.write("</table>");</script></body></html> Can anyone help? Is there a different way I need to make the SOAP endpoint call?Thanks in advance
×
×
  • Create New...