Postagens

Mostrando postagens de março, 2010

Real-time XML Syntax Highlighter in Javascript - EditArea

If you are looking for a Real-time XML Syntax Highlighter and in the same time you want it as a web based lightweight tool then EditArea is the perfect solution for that. In WSO2 ESB 3.0.0(up coming release) , I've integrated all the source(xml) fields with EditArea highlighter to give the use a real-time rich xml editing experience. However, the original highlighter comes with some dull colors for XML Syntax as well as for controllers. So, I modified the EditArea source and came up something like this. (It takes few seconds to load..;)) EditArea support syntax highlighting not only in XML but many other programming languages including Java,PHP, C/C++, CSS, Perl, Ruby, Python and many more. I have hosted a modified version of EditArea which supports Real-time XML Syntax Highlighting here . So, EditArea is one of the rear opensource tool that is specifically designed to support Real-time syntax highlighting for most of the popular programming languages and yet it runs with its ext...

Preserving CDATA sections - AXIOM StAX parsing

In XML CDATA sections provide a way to tell the parser that there is no markup in the characters contained by the CDATA section. And that makes it much easier to create documents containing sections where markup characters might appear, but where no markup is intended. CDATA is commonly used for scripting language content and sample XML/HTML content. So in context of Web Services with Apache Axis, the default settings of the AXIOM StAX parser would ignore the CDATA sections and won't preserve them after the parsing is done. In coalescing mode, the parser will not only coalescing adjacent text nodes, but also CDATA sections. However there are cases that you need to preserve CDATA section after parsing and creating OMElement. So, in such a scenario you need to switch off the coalescing mode by setting a property in XMLInputFactory. (i.e.: "javax.xml.stream.isCoalescing" = false). The following code will create an AXIOM OMElement with preserving CDATA. For detailed overview...