Wednesday, June 10, 2009

WAS V7 XML Feature Pack Beta Refreshed (With focus on XSLT 2.0)

Today we have released an updated XML Feature Pack Beta. The beta is available here.

Since the first release two months ago (which had full XPath 2.0 and partial XSLT 2.0/XQuery 1.0), we have added quite a bit to XSLT 2.0 (making us nearly spec complete) and more to XQuery 1.0.

Among the biggest features added in the XSLT 2.0 area is XML Schema awareness. This includes validation which allows you to validate (make sure it contains data that is allowed per the schema) the incoming data to transformations, temporary trees of data, and output data from transformations. Also, as is important when working with vertical industry standard schemas, our schema awareness support includes schema assessment. This means that your XSLT stylesheets know when an attribute or element content is an integer or date and you can treat it as such. Taking this to the next level, if you extend your industry standard schema type of a bill of materials, you can write templates that match that type (schema-element(*, tns:BillOfMaterialsType)). In the past you would have had to made templates that were of the industry standard element names as well as all extending element names (tns:BillOfMaterialsName, mycompany:FullfillmentBillOfMaterialsName, mycompany:PurchasingBillOfMaterialsName, etc.).

Other new XSLT 2.0 features in this refresh are collections support (allows multiple input data sources in a well defined way), "undeclare-prefixes" serialization parameter(simplifies namespace in XML 1.1), next-match (allows you to call overridden templates) element, required parameters and "as" attributes (helps guarantee stylesheet elements are called correctly) and full support of XSLT keys.

Another major feature of this refresh is ability to pre-compile XML artifacts. This refresh contains tools that compile XPath, XSLT, and XQuery to java classes. These classes are basically the same logic that previously was interpreted by the XML runtime. However, with them now being compiled, they run much faster than interpreted. The refresh offers three modes:

  • interpreted - best when the XML artifacts are created ad hoc at runtime and not reused

  • compiled - best when the XML artifacts are created ad hoc at runtime but reused

  • pre-compiled - best when the XML artifacts are known at compile time of your application

We have also expanded our XQuery 1.0 support in this refresh.

Please let me know if any of these new features help you in your applications. I'm excited to hear of all the applications that are being tested against this functionality.

Finally, I have created another three demos to be posted on YouTube. Over the couple of days, I'll post them with links here. Hopefully they will help you understand how to use this functionality in your own applications.