Re: [Dev] Xpath expression to fetch a property which has space in name

2016-05-11 Thread Praneesha Chandrasiri
hi Rajith, I added the above information under a topic named "Converting spaces" in docs of ESB 4.9.0 and above, as for example in [1]. Also, I added a comment in the JIRA in [2]. Thanks for the support! [1]

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-05-10 Thread Rajith Vitharana
Hi All, This can be avoided by using "synapse.commons.json.buildValidNCNames" to value "true" in /repository/conf/synapse.properties file, This will replace space in the json to "JsonReader_32" value. So sample would be as follows input Json - { "abc nnn": "value1" } output XML - value1

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Udara Liyanage
Hi, Yes, I also think it is a bug in json to xml conversion. I will create a jira for this. ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Rasika Perera
​Hi Jonathan, Please find the inline comments. ​ > If it were me I’d try a workaround transforming the spaces to underscores > or something in the JSON before converting it to XML, and file some JIRAs > on the buggy conversion algorithm. ​Agreed. totally +1.​ Probably replacing with an

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Jonathan Marsh
FWIW, XML also requires attributes to have the =”” part. Looks like we are using a buggy JSON-XML conversion library if it’s generating malformed XML. If our XPath is working on that at all it’s also buggy. There is no convention in XML itself for escaping spaces in names, it will have to be a

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Rasika Perera
Hi Udara, According to the W3C XML 1.0 Specification you *cannot* have spaces on the XML element name. To be precise; [4a] NameChar::=NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] [5]Name::=

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Udara Liyanage
Hi, It gives me following error. Below is my synapse configs. ##call external api https://api.peoplehr.net/Query"/> #iterate thru results Sample API

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Keerthika Mahendralingam
Hi Udara, Since you are getting JSON response, I think you can use json-eval to get the value form response like, Thanks, On Mon, Mar 7, 2016 at 2:31 PM, Udara Liyanage wrote: > Hi, > > We have an call mediator which calls and external API. API response is > json. Json

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Udara Liyanage
Hi, We have an call mediator which calls and external API. API response is json. Json properties has spaces in names. { "Department": "ENGINEERING", "Employee Id": "LK", "First Name": "Udara", } ESB converts this to xml, those xml element names also

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-07 Thread Udara Liyanage
Hi, Below is the log mediator output. Even the converted xml tag has space in its name. [2016-03-07 14:00:36,587] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:2b6e4e6d-9180-4083-b06b-d12c08c5178e, Direction: request,

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-06 Thread Udara Liyanage
Hi Thusitha, I already tried that, but negative. On Mon, Mar 7, 2016 at 11:59 AM, Thusitha Thilina Dayaratne < thusit...@wso2.com> wrote: > Hi Udara, > > Did you tried replace the space with "_x0020_"? according to the [1] it > seems work for spaces > [1] - >

Re: [Dev] Xpath expression to fetch a property which has space in name

2016-03-06 Thread Thusitha Thilina Dayaratne
Hi Udara, Did you tried replace the space with "_x0020_"? according to the [1] it seems work for spaces [1] - *http://users.jackrabbit.apache.narkive.com/r9aFPfiI/xpath-query-with-space-in-node-name *

[Dev] Xpath expression to fetch a property which has space in name

2016-03-06 Thread Udara Liyanage
Hi, I am trying to fetch an property value from a json payload similar to below. { "Department": "ABC", "Employee Id": "123", "Work Email": "ud...@wso2.com" }, I could extract Department value by below xpath expression. However when I found