andrekutianski / x2js

Automatically exported from code.google.com/p/x2js
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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 commented 8 years ago
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 commented 8 years ago
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 commented 8 years ago
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