Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Ignoring invalid XML element names from object properties #35

Open
GoogleCodeExporter opened this issue Nov 9, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Let's say we have an object:


{
  $$hashKey: 3,
  element1: "something",
  element2: "something else"
}


Then, when we pump this through `x2js.json2xml_str()`, it will fail. The 
`$$hashKey` is an invalid name.

It would be nice to configure this to either fail or ignore those pesty 
properties... or have a service to strip out invalid properties.

Would this idea be something you'd consider?

Original issue reported on code.google.com by johngeor...@gmail.com on 27 Jan 2015 at 7:43

@GoogleCodeExporter
Copy link
Author

Bump.

I'm happy to attempt the approach as long as you're interested in the idea.

Original comment by johngeor...@gmail.com on 2 Feb 2015 at 9:30

@GoogleCodeExporter
Copy link
Author

no error for me (v1.1.5) , returns:

<$$hashKey>3</$$hashKey><element1>something</element1><element2>something 
else</element2>

Original comment by rickm...@gmail.com on 2 May 2015 at 12:57

@GoogleCodeExporter
Copy link
Author

I'll think about a new feature to filter any specified properties.

Original comment by abdulla....@gmail.com on 20 May 2015 at 9:59

  • Changed state: Accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant