>End of year cramps.

>This is a rambling list of cramps floating around in my head, where it is head is anybody’s guess.

XPath Content Assistance and Validation.

One of the community members for XSL Tools made a request to have XPath Assistance, and Validation support. Well, we already do provide some basic XPath function and accessor assistance, and basic syntax checking on the XPath, but that is about it.

Well, with the extended holiday weekend, and a cat that decided I was to be a cushion the entire day, I started off on seeing what I could do about the bug. One of the features I always liked about Oxygen XML, was the XPath Aware content assistance it provided, particularly when it came to the Input document:

The above image is from Oxygen XMLs implementation, and it is pretty smart. One thing that always bothered me about this implementation is that you had to associate a Input XML to the particular stylesheet. This was accomplished through setting up a transformation scenario. However this always seemed liked an extra step, especially since they had an XML Catalog that could have been leveraged, and the namespaces were defined typically within the stylesheet being used.

I tried on and off over the years to get Oxygen XML to leverage the Web Standard Tools framework for eclipse instead of inventing it themselves, but alas they continue on their own. So for bug 259575, I’ve taken a different approach in implementing this with XSL Tools. XSL Tools will try to provide proposals of available elements from the Namespaces that have been defined. It does this by leveraging the ContentModel that is created when the stylesheet is loaded. The ContentModel is created by the resolvers and xml catalog implementation, and the namespaces and grammars defined. The Xpath content assistance has been implemented, for select, test, and match attributes. However, it currently doesn’t try to filter the proposals down, as Oxygen XML does. That will be the next step to make it a little more aware.

XML and Eclipse

The last year I have worked as an XML Evangelist within the eclipse community. The role of Eclipse evangelist is pretty well taken by others more experienced and passionate about eclipse as whole, than I am. I’m still amazed by how much of XML that is created is not backed by some sort of model, whether that be an EMF model, XSD, or DTD. Most is just free form. Do not even get me started on how the XML Schema is used within the PDE for extensions, I could write a whole blog on that alone. Some of these problems are education issues with the developer community, most don’t think about having or requiring a model for the xml files. Introduce the concept of XML with namespaces, and watch the question marks start to form above their heads.

I guess unless you work with XML consistently it just appears like a convient way to dump objects. Unfortunately that seems to be rule rather than the exception. Hopefully that can be addressed over the next year.

In general in the the XML community, when you think of XML tooling, you don’t think of eclipse. If you do, it is because of OxygenXML and it’s eclispe plugin. Until this last year, I would definitely agree that the existing support from the web tools platform has been very buggy, with spotty understanding at times of the various specifications. There is still a gapping hole in the WTP DOM implementation, and some misunderstandings of how certain XML specific features are to work (i.e. the xml prefix always resolving to the xml namespace, i.e. xml:space, xml:lang attributes should always return the xml namespace, not null).

With this said, the release of Web Tools Platform 3.0 greatly improved specification compliance. The editor no longer cares what order attributes and namespaces are defined (yes it was order dependent in the past). The performance of the XSD editor when working with large real world schemas by various standard organizations is much improved. There also has been a little bit of revitalization on the tooling front, primarily generated by the eclipse user community and not the strategic members.

This last point is pretty key, as the strategic members working on the Web Tools Platform are primarily interested in the JEE implementation with a little bit of XML. XML is primarily just another Source Editor lumped in with web related technologies like HTML, CSS, JSP, and JavaScript. The problem here is that to many of the strategic members they only focus on the use cases that are of concern to the products they develop. This is understandable to a point as the committers are being paid by their companies to work on it.

The commiters working on this may have the expertise in the related JEE specs, and the xml specifications that go with them, but may not be as familiar with the overall picture of the specs. As an example, the current WTP DOM does not support the concept that Attributes have nodes. However according to the DOM Level 1 spec, they do have Text and Entity Reference nodes. But because changes to the way the DOM is implemented might break existing adopters there is resistance to change to make a compliant implementation.

Overall, the support has improved, but it needs to get better. The only way that is going to happen is to bring in more expertise on implementing the various XML specifications. Bugs in the current implementations when they break compatibility or violate the rules of a specification needs to be addressed sooner rather than later. Yes this may break some existing strategic members implementations, but it promotes a more stable and compliant product for the eclipse xml community as a whole. It makes the tooling being built off of WTP more stable and compatible with other XML tooling out there. Long term this compliance is not going to come from the strategic members as they will always go with the features that are key to their products. The support will have to come from the community in the way of new committers or contributions and patches. I have done my share over the last year to help where I can with patches and contributions. I still plan to do more, but help from the whole XML community is needed as well.

New XML Tooling at Eclipse.

With the above statement, this last year actually has seen a new focus on some XML tooling at eclipse. XSL Tools is picking up steam, and there is renewed interest in a revitalized Visual Editor for XML (VEX) after it moved from sourceforge to eclipse. In addition, Dominick Schadow has brought over XML Security Tools for working with Encryption and Digital Signatures, and the XQuery Development Tools google summer of code project, has also made it’s way into the WTP incubator. The SOA project is working on a WS-Policy Editor, as well as some renewed interest in Declartive UI design by E4.

There is still more that needs to be done though. RelaxNG and NVDL support are starting to grow outside of the traditional strategic members. REST is reviving as a way to do web services without the bloat of the WS-splat set of specifications. As the use of XML continues to spread it is more critical that the frameworks and tooling that make this easier to use and implement are also compliant. I hope to continue to see the growth in 2009, and continued improvement on the compliance stand point. I also hope that the developer community looks to leverage and create models for the XML that they use. Learn to use EMF, DTD, and particularly XML Schema to their full extent in the way of validation. If you don’t already know it, learn XPath for helping to manipulate your DOM related XML documents. Learn XSLT and XQuery. Do less with the DOM and more with XML Databases. Do less data binding of your XML, you’ll have more control. If you do data bind, be aware of how your choosen data binding framework works. Just because you can bind, doesn’t mean you should.

I see a brighter future for XML at eclipse over the next year. I hope that those in the eclipse and XML community will help to continue to improve the basic support, so that first class commercial quality applications that leverage this support can continue to be built.

Have a happy and safe new year.

This entry was posted in eclipse, standards, xml. Bookmark the permalink.

7 Responses to >End of year cramps.

  1. >Nice post, and many thanx for pushing XML in Eclipse…For Bioclipse, we wanted to have a Chemical Markup Language editor based on the XML editor from Eclipse, but I never quite worked out how to hook up a local XML Schema (is there Schematron, or RelaxNG support too?) to a namespace, so that it will always validate, even is the xsi:schemaLocation is not resolvable… Does the new code have a catalog of some sort, where I can register a XML Schema we have in a Bioclipse Plugin, so that the XML editor will pick it up for rich editing?

  2. David Carver says:

    >Egon: look at the org.eclipse.wst.xml.catalog extension. You can contribute DTD, or XML Schemas with Namespaces to the catalog. If you take a look at the org.eclipse.wst.standard.schemas plugin in the CVS repository for web tools (in the source editing folder). It’ll give you what you want.Once it’s added to the catalog you can get all of the content assistance without having to define an xsi:schemaLocation.You can also create a custom URIResolver as well, this is what we do for XSLT in XSL Tools because we need to load a different schema depending on what version of XSLT is being editted.

  3. David Carver says:

    >Oh and one other note, no this currently isn’t support for RelaxNG or SchemaTron (the later you might be intersted in the SchemaTron for Eclipse plugin at sourceforge.)The validation framework is there where Trax could be plugged in for RelaxNG validation, and I am thinking of suggesting for a SOC project for a RelaxNG editor.For a commercial eclipse plugin for both of these, check out OxygenXML, it has this support.

  4. >David, oh, that’s just perfect. Much of what I do right now is XML Schema, so I don’t worry about lack of RelaxNG/Schematron right now…I’ve added the extension point, but now actually facing the problem of having my .cml file open up in the XML editor… how can I associate the file extension with the proper WST XML editor that picks up the above extension?

  5. dcarver says:

    >Eclipse platform has a Content type extension point. You’ll want to add your .cml extensions to the XML content type, or create a content type for CML and place it under the XML content type.Most of what you are looking for can be found in the 2008 eclipscon tutorial.Extending the XML and SSE Editors

  6. >Actually, attempts at content model implementations for Schematron and RelaxNG could help in validating the current internal API. There’s always a fear that even with the 4 implementations in WTP (XSD, DTD, HTML, and TLD), we’ve overlooked something. Those implementations date back 5+ years, and if the API is good enough to express Schematron and RelaxNG, everyone would feel better about making it real API.

  7. >Hi David/Nitin,thanx for your help here and on #eclipse.I have written up the results in my blog:http://chem-bla-ics.blogspot.com/2008/12/editing-and-validation-of-cml-documents.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s