Hi,

The parameter passed for the method convertE4XtoJSON is String right. But I
get the following error when I use the code.

*org.mozilla.javascript.EcmaError: TypeError: Cannot find function
localName in object
<employees><person><name>Tove</name><age>32</age></person><person><name>Jani</name><age>26</age></person></employees>.
(xml#49)*

Is there any specific format the string needs to be in?

On Tue, Jan 27, 2015 at 9:56 PM, Sabra Ossen <[email protected]> wrote:

> Hi,
>
> I will try the package as suggested.
>
> Thanks.
>
> On Tue, Jan 27, 2015 at 9:28 PM, Buddhima Wijeweera <[email protected]>
> wrote:
>
>> Hi,
>>
>> This package will help you on this:
>>
>> https://github.com/wso2/product-es/tree/greg-changes-asset-extensions/modules/jaggery-modules/utils
>>
>> Sample usage :
>> var utils=require('utils').xml;
>> utils.convertE4XtoJSON(<XML String>)
>>
>> Thanks!
>>
>> On Tue, Jan 27, 2015 at 9:23 PM, Sabra Ossen <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Is there any method to convert an xml string (ex :
>>> "<employees><person><name>Tove</name><age>32</age></person><person><name>Jani</name><age>26</age></person></employees>")
>>> to a json object using jaggery, I need to access the JSON object in
>>> jaggery.
>>>
>>> Currently I am using JAXB to convert the xml to a Java Object and the
>>> write the json in jaggery. Is there any work-around to achieve the
>>> mentioned functionality.
>>>
>>> Any help is appreciated.
>>>
>>> Thanks.
>>>
>>> --
>>> Sabra Ossen
>>> *Software Engineering Intern*
>>> Mobile : +94 (0) 785 227 769
>>> [email protected]
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Buddhima Wijeweera
>> Software Engineer; WSO2 Inc.; http://wso2.com ,
>>
>> Mobile: +94 71 427 9966
>> Email: [email protected]
>> Blog:   https://buddhimawijeweera.wordpress.com
>> GitHub Profile: https://github.com/Buddhima
>>
>
>
>
> --
> Sabra Ossen
> *Software Engineering Intern*
> Mobile : +94 (0) 785 227 769
> [email protected]
>



-- 
Sabra Ossen
*Software Engineering Intern*
Mobile : +94 (0) 785 227 769
[email protected]
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to