Git Product home page Git Product logo

Comments (6)

vinitkumar avatar vinitkumar commented on June 15, 2024

Could you post a JSON that you are trying to convert to XML. It could help me debug this. Honestly, I never came across this issue before so I might have to look into it.

from json2xml.

ts-kazuo-ieiri avatar ts-kazuo-ieiri commented on June 15, 2024

Here is the json file.

{'methodCall': {'methodName version="1.0"': 'XXXXXXXXXXXXXXXXXXXXXXX',
                'params': {'param': [{'name': 'REGISTE_DATE',
                                      'value': '2018/5/28 0:01'},
                                     {'name': 'SEX', 'value': 1},
                                     {'name': 'TEL1', 'value': 244985344},
                                     {'name': 'TEL2', 'value': 0},
                                     {'name': 'EMAIL',
                                      'value': '[email protected]'},
                                     {'name': 'POST_CD', 'value': '969-6223'},
                                     {'name': 'ADDRESS',
                                      'value': 'fukushimaken '
                                               'oonumagunaizumisatomachi '
                                               'asahiterairi'},
                                     {'name': 'NAME1',
                                      'value': 'Oosaki Matsuo'}]}}}

from json2xml.

vinitkumar avatar vinitkumar commented on June 15, 2024

@ts-kazuo-ieiri It doesn't look like a json object but a dict, I had to clean it up and use json.dumps(dict_object) to get something like this:

{
    "methodCall": {
        "methodName version='1.0'": "XXXXXXXXXXXXXXXXXXXXXXX", 
        "params": {
            "param": [
                {"name": "REGISTE_DATE", "value": "2018/5/28 0:01"}, 
                {"name": "SEX", "value": 1}, 
                {"name": "TEL1", "value": 244985344}, 
                {"name": "TEL2", "value": 0}, 
                {"name": "EMAIL", "value": "[email protected]"}, 
                {"name": "POST_CD", "value": "969-6223"}, 
                {"name": "ADDRESS", "value": "fukushimaken oonumagunaizumisatomachi asahiterairi"}, 
                {"name": "NAME1", "value": "Oosaki Matsuo"}
            ]
        }
    }
}

Also, I had to clean this by hand after doing json.dumps for this object.

"methodName version=\\"1.0\\"": "XXXXXXXXXXXXXXXXXXXXXXX",

from json2xml.

ts-kazuo-ieiri avatar ts-kazuo-ieiri commented on June 15, 2024

@vinitkumar I checked that after executed json.dumps(dict_object), the json data can be set like this.
req = requests.post(url, data=json_data)
I don't have problem with end tag and parameter has been set correctly.

Thank you!

from json2xml.

vinitkumar avatar vinitkumar commented on June 15, 2024

@ts-kazuo-ieiri Okay, if you think your issue has been resolved then please close the ticket.

from json2xml.

ts-kazuo-ieiri avatar ts-kazuo-ieiri commented on June 15, 2024

@vinitkumar Yes this issue has been fixed. thank you so much.

from json2xml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.