Sponsored Content
Top Forums Programming [XQuery] How to Convert from JSON Message to XML Message with XQuery Post 302578643 by MrSudoSu on Friday 2nd of December 2011 04:54:06 AM
Old 12-02-2011
Re: [XQuery] How to Convert from JSON Message to XML Message with XQuery

You can use an example distributed with Sausalito (28msec.com). Install the coresdk and execute:

Code:
sausalito create template -n json

then you can see and play with some json conversions in json/handlers/doublesearch.xq (online:28msec.com/source/show/json/handlers/doublesearch.xq) and json/lib/controller/search.xq (online:28msec.com/source/show/json/lib/controller/search.xq).

In particular, what you need is the parse function from this module 28msec.com/api/reference/datatypes/json#parse-1

Sorry, for posting that many links, but I hope it helps.
 

8 More Discussions You Might Find Interesting

1. Programming

How to limit max no of message in a posix message queue

Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies

2. Shell Programming and Scripting

Need to extract XML message from log

I need help to extract a following SOAP-ENV:Header XML message from the log. XML message need to be extracted: *************************** <SOAP-ENV:Header> <ServiceGatewayHeader> <SourceApplicationId>OXL</SourceApplicationId> <Version>1.0</Version> <UserId>TEST</UserId>... (4 Replies)
Discussion started by: tjshankar
4 Replies

3. Shell Programming and Scripting

Move xml files from unix to message queue.

Hi, I need to move the XML files from the UNIX to the message queue. Please help me out to write the code.. Thanks, Mohana Krishnan (0 Replies)
Discussion started by: krishnan_6015@y
0 Replies

4. UNIX for Dummies Questions & Answers

Unable to extract a tag from a very long XML message

Hi I have a log file which contain XML message. I want to extract the value between the tag : <businessEventId>13201330</businessEventId> i.e., 13201330. I tried the following commands but as the message is very long, unable to do it. Attached is the log file. Please provide inputs. --... (3 Replies)
Discussion started by: Sapna_Sai
3 Replies

5. Programming

Validate queries XQUERY

Hi! I am working in an application jsp-java-xml , and i need to validate queries in xquery. For example If I put (in a text field) "for $x in XXX/yyy return data($x/tittle)" I need a bean(class) that show if the text is correct or not. And, if were posible, show the syntax error too. ... (2 Replies)
Discussion started by: avatarrr
2 Replies

6. Shell Programming and Scripting

Extract XML message from a log file using awk

Dear all I have a log file and the content like this file name: temp.log <?xml version="1.0" encoding="cp850"?> <!DOCTYPE aaabbb SYSTEM '/dtdpath'> <aaabbb> <tranDtl> <msgId>000001</msgId> </tranDtl> ..... </aaabbb> ... ... (1 Reply)
Discussion started by: on9west
1 Replies

7. Programming

[Xquery] How to do a increment in a For loop

Hello men. How can i build a simple increment for $a by Xquery such as ? let $a := 0 for $i in (1 to 10) let $a := $a + 1 return $a why a in this loop always is '1' Thank you for reading, its will really helpful for my job if i can solve this problem :D:D (3 Replies)
Discussion started by: tien86
3 Replies

8. Shell Programming and Scripting

Convert json to xml

Hello everyone, I have created a workflow that will pull down data via a RESTful API in JSON, then my code parses and modifies said data. The problem I have is that these APIs I am working with only accept XML to PUT/POST data, and I am looking for an easy way to convert my JSON file to XML. ... (2 Replies)
Discussion started by: Zaphod_B
2 Replies
Mail::Message::Convert::EmailSimple(3pm)		User Contributed Perl Documentation		  Mail::Message::Convert::EmailSimple(3pm)

NAME
Mail::Message::Convert::EmailSimple - translate Mail::Message to Email::Simple vv INHERITANCE
Mail::Message::Convert::EmailSimple is a Mail::Message::Convert is a Mail::Reporter SYNOPSIS
use Mail::Message::Convert::EmailSimple; my $convert = Mail::Message::Convert::EmailSimple->new; my Mail::Message $msg = Mail::Message->new; my Email::Simple $intern = $convert->export($msg); my Email::Simple $intern = Mail::Internet->new; my Mail::Message $msg = $convert->from($intern); use Mail::Box::Manager; my $mgr = Mail::Box::Manager->new; my $folder = $mgr->open(folder => 'Outbox'); $folder->addMessage($intern); DESCRIPTION
The Email::Simple class is one of the base objects used by the large set of Email* modules, which implement many e-mail needs which are also supported by MailBox. You can use this class to gradularly move from a Email* based implementation into a MailBox implementation. The internals of this class are far from optimal. The conversion does work (thanks to Ricardo Signes), but is expensive in time and memory usage. It could easily be optimized. Converters between message objects Other converters METHODS
Constructors Mail::Message::Convert::EmailSimple->new(OPTIONS) See "METHODS" in Mail::Message::Convert Converting $obj->export(MESSAGE, OPTIONS) Returns a new Email::Simple object based on the information from a Mail::Message object. The MESSAGE specified is an instance of a Mail::Message. example: my $convert = Mail::Message::Convert::EmailSimple->new; my Mail::Message $msg = Mail::Message->new; my Mail::Internet $copy = $convert->export($msg); $obj->from(OBJECT, OPTIONS) Returns a new Mail::Message object based on the information from an Email::Simple. example: my $convert = Mail::Message::Convert::EmailSimple->new; my Mail::Internet $msg = Mail::Internet->new; my Mail::Message $copy = $convert->from($msg); $obj->selectedFields(HEAD) See "Converting" in Mail::Message::Convert Error handling $obj->AUTOLOAD() See "Error handling" in Mail::Reporter $obj->addReport(OBJECT) See "Error handling" in Mail::Reporter $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) Mail::Message::Convert::EmailSimple->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) See "Error handling" in Mail::Reporter $obj->errors() See "Error handling" in Mail::Reporter $obj->log([LEVEL [,STRINGS]]) Mail::Message::Convert::EmailSimple->log([LEVEL [,STRINGS]]) See "Error handling" in Mail::Reporter $obj->logPriority(LEVEL) Mail::Message::Convert::EmailSimple->logPriority(LEVEL) See "Error handling" in Mail::Reporter $obj->logSettings() See "Error handling" in Mail::Reporter $obj->notImplemented() See "Error handling" in Mail::Reporter $obj->report([LEVEL]) See "Error handling" in Mail::Reporter $obj->reportAll([LEVEL]) See "Error handling" in Mail::Reporter $obj->trace([LEVEL]) See "Error handling" in Mail::Reporter $obj->warnings() See "Error handling" in Mail::Reporter Cleanup $obj->DESTROY() See "Cleanup" in Mail::Reporter $obj->inGlobalDestruction() See "Cleanup" in Mail::Reporter DIAGNOSTICS
Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. SEE ALSO
This module is part of Mail-Box distribution version 2.105, built on May 07, 2012. Website: http://perl.overmeer.net/mailbox/ LICENSE
Copyrights 2001-2012 by [Mark Overmeer]. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2012-05-07 Mail::Message::Convert::EmailSimple(3pm)
All times are GMT -4. The time now is 12:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy