dtxpz8785 2017-02-07 10:02
浏览 104
已采纳

Python - XML格式不正确(无效标记)调试值

I'm getting this error when I try to import some of the saleorders, I need to debug the values of the return statement but i'm not getting anything but errors. The code is working for the majority of the saleorders but i get in the error on a couple of orders and i can't identify the error.

I try with print_r() and var_dump() but is not working.

Python is returning the error "ValueError: "not well-formed (invalid token)".

Thanks.

$saleorders[] = new xmlrpcval( array("id" => new xmlrpcval( $row[0], "int"),
                "price_type" => new xmlrpcval( clean_special_chars($price_type), "string" ),
                "note" => new xmlrpcval(clean_special_chars($note), "string" ),
                "lines" => new xmlrpcval( $orderlines, "array"),
                "pay_met" => new xmlrpcval( search_payment_method($row[24]), "int"),
                "pay_met_title" => new xmlrpcval( clean_special_chars($row[24]), "string"),
                "shipping_price" => new xmlrpcval( $shopping_price, "double"),
                "shipping_title" => new xmlrpcval(html_entity_decode(clean_special_chars($shipping_title)), "string"),
                "orders_status" => new xmlrpcval( clean_special_chars($status), "string"),
                "partner" => $partner,
                "date" => new xmlrpcval( $row[21], "string"),
                "address" => $default_address,
                "delivery" => $delivery_address,
                "billing" => $billing_address,
                "order_subtotal" => new xmlrpcval($order_subtotal, "double"),
                "order_tax" => new xmlrpcval($order_tax, "double"),
                "order_total" => new xmlrpcval($order_total, "double"),
            ), "struct");

return new xmlrpcresp(new xmlrpcval($saleorders, "array"));
  • 写回答

1条回答 默认 最新

  • douyinbo3361 2017-02-08 07:38
    关注

    Try with the method serialize of the xmlrpcval to see the values Link: https://gggeek.github.io/jsxmlrpc/javadoc/xmlrpcval.html#serialize

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀