Convert XML/SOAP to Maps in Community edition - mule

I know Datamapper can easily convert an XML structure to a map easily. But what is the best way to do this in Community edition? Note I want Maps rather than a concrete class sung Jaxb.
The json-to-object-transformer allows you to easily convert to a map but is there anything similar for XML?

As of now Mule Community Edition doesn't provide any out of the box solution for this.
You can always crate a Custom transformer and use some API like XStream to convert the XML to map.
Following Stackoverflow post give you a sample of how to use XStream API.
How to convert XML to java.util.Map and vice versa
Hope this helps.

Related

What support for XGMML or other stable formats is in Cytoscape.js?

I see that Cytoscape.js has many of the great features of Cytoscape Web. But I don't see XGMML support in Cytoscape.js. Is that correct? Is XGMML graph support on the roadmap or is there some simple way to convert XGMML files into a format that Cytoscape.js can read XGMML in ?
What are the plans for plans for stable document formats?
Thanks
Ted
Ted Goldstein, Ph.D.
UC Santa Cruz Genomics Institute
xmojmr makes a good point that this isn't really a concrete code help question.
In any case -- in my opinion, formats like that ought not to be in the scope of the Cytoscape.js project. Cytoscape.js is a graph library for JS, and file parsing should be a separate library. Such a library would not even need to support the particular Cytoscape.js JSON "format", because it's very simple to map one array of objects (resultant from the parse) to the hierarchy expected by Cytoscape.js.
The XGMML format itself isn't very good in my opinion, and that's another strike against including it. Many people do have legacy data in that format though, so you may find a generic JS XML parsing lib useful. If you just need the graph data from the XGMML, then using a JS XML parsing lib should make it fairly straightforward to map to whatever JSON format you like.

Extract interface implementation with Astah API

I'm developing a parser for UML and I'm using Astah API to parse a .asta file.
I want to parse classes diagrams, but I can't figure out how to extract the interfaces that a class implements.
I've read the API doc which can be found here API doc
but all these getClientDependencies(), getClientRealizations(), getSupplierDependencies(), getSupplierRealizations() don't work, they just return me an empty list.
Never mind, fellows,
The API doc provided was pretty correct. The UML diagram I was using to test was kinda wrong.
Thanks anyway

Parsing YouTube XML

I'm looking to do a little iOS app that uses has some very basic YouTube interaction. When I say basic, I really mean it: All it needs to do it pull in the uploads from a particular user, the videos' links, titles and maybe a thumbnail.
I've been looking at the Google developer docs for YouTube and nothing seems to be of help. It seems that the data is stored in an XML format, but it seems completely different to the structure of the sample XML in the docs. I don't know whether I'm using the wrong link (this is a sample of what I'm looking at now), but I just get a really messy XML document.
I've really no idea where to start on this one (with regards to a parser) - it just looks so messy. If someone could point me in the right direction with this, maybe even a with some sample code on a parser, I'd be incredibly grateful.
Thanks,
K
Have you considered making use of gdata-objectivec-client api http://code.google.com/p/gdata-objectivec-client/ It comes with samples which provide exactly what you are looking for.
Here's a very concise and easy-to-read example using NSXMLParser. It provides an example xml and shows you how to parse its elements and populate a custom object with the values.
i can suggest you to use LIBXML 2.2 it's easy to use and you can use Xpath Query to fetch whatever you want from any messy file.
To learn how to use that look at this page. link
The XML link you provided looks like the atom feed. If you don't feel like parsing the XML in your code, you can try the TouchRSS (https://github.com/TouchCode/TouchRSS) which I used to parse the youtube RSS feed. The RSS feed version should be in version 2 so the url you provide should change to http://gdata.youtube.com/feeds/base/users/DJ3Lau/uploads?orderby=updated&alt=rss&v=2.

How to Read Parse XML in Objective C?

What framework I should use to grab XML from a http and parse that?
Start here:
http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSXMLParser_Class/Reference/Reference.html
You can use the initWithContentsOfURL initializer to actually load the document from the HTTP source.
Try touchXML:
TouchXML is a lightweight replacement
for Cocoa's NSXML* cluster of classes.
It is based on the commonly available
Open Source libxml2 library.
Here is a nice tutorial.
Source has moved a bit, can be found here

Write to XML file using Objective-C

OK, I managed to read from an XML file using NSXMLParser, but now I don't know how to write to an XML file. I have an XML file, say:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<user id="abcd" password="pass1"/>
<user id="efg" password="pass2"/>
</root>
Now when a new user enters details, I want to store them in a new tag. Lets say like, the id is "hhhh" and password is "pass3".
I want to add a new tag with attributes as such:
<user id="hhhh" password="pass3"/>
to the XML file.
How should I do this? Please explain in an elaborate way. I am a newbie here. Any links to tutorials or examples will be much helpful.
Thanks.
Check out the Tree-Based XML Programming Guide. You might use NSXMLDocument and friends. You could also search the web for open-source alternatives (there are plenty that parse and a few that write). A quick Google search for "using NSXMLDocument" yields several third-party tutorials.
It's better that you read the documentation yourself first and ask more specific questions. Help us help you. :-)
There's a number of really good third party XML parsers you can take a look at that will probably make it easier on you.
Here's a good post I found talking about them. http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
Try using kissxml.
The goal is to create an NSXML style API that can used in environments without NSXML (e.g. iPhone).
KissXML was inspired by the TouchXML project, but was created to add full support for generating XML as well as supporting the entire NSXML API.
Please support this free and open source project
address