On 23/08/11 16:35, Radoslav Husar wrote:
> Hi guys,
>
> is there any documentation (or examples) for the sf-xml components? I
> haven't found anything helpful :-/
>
> http://www.smartfrog.org/wiki/display/sf/sf-xml
>
-Sorry for not replying; I've been on vacation and the others on the
team don't seem to be replying either. Sorry.
No, there's not much there, is there?
I use it primarily as a way of distributing versions of the main XML
libraries for other components: xmlapis+ xerces, xalan, jdom, xom
The SF components inside were stuff I wrote to work with Xom and
generate XML Content. There is a test example of it
#include "org/smartfrog/services/xml/components.sf"
/**
* test a document
*/
rootDoc extends XmlDocument {
root extends XmlElement {
textElement ROOT:textElement;
}
}
textElement extends XmlTextNode {
text "this is a nested text element";
}
sfConfig extends rootDoc ;
This isn't that useful. Looking in the code there is a set of attributes
which support XML-namespaced qnames, and after building up a tree of
them can be saved to an XML file, or, by the look of things, sent over
the wire. I don't see anything there to load an XML document, though it
looks the kind of thing that I'd do next.
The last big stuff I did with XML in SF was working with the "Alpine"
SOAP stack, but even that was using Xom, rather than XML-in-SF; I think
it depended on sf-xml just for the dependencies and maybe some helper
methods.
XML should match fairly easily to the SF language, but in practise it
doesn't for some reasons you will soon recognise if you spend too much
time in XML-land
-XML namespaces and the notion of a qualified name on elements and
attributes.
-the difference between nested elements and simple attributes
-the way you can have multiple text elements directly under a node
with nested elements in between them.
JSON is a far more compatible format, and where we've been drifting to
in our use of things recently.
If you really want to work with the sf-xml stuff then you can talk to me
and we'll see how to improve things - I do think Xom is the best way to
work with XML in Java, whereas the DOM APIs are probably the worst. That
said, now we've been doing a fair bit of Groovy work that would be even
better as I'd be able to inject new methods into every XML node without
having to worry about which XML node factory it came from.
-steve
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Smartfrog-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartfrog-users