XmlPrime is an XML Processor for the Microsoft .NET platform versions 2.0 or later. It builds upon the classes in the System.XmlSystem.XmlSystem.Xml namespace and provides up-to-date standards compliant implementations of XSLT 2.0, XQuery 1.0, XPath 2.0 and XInclude.
XmlPrime implements the following W3C Recmmendations.
- XQuery 1.0: An XML Query Language (Second Edition)
- XML Path Language (XPath) 2.0 (Second Edition)
- XSLT 2.0 and XQuery 1.0 Serialization (Second Edition)
- XQuery 1.0 and XPath 2.0 Functions and Operators (Second Edition)
- XQuery 1.0 and XPath 2.0 Formal Semantics (Second Edition)
- XQuery 1.0 and XPath 2.0 Data Model (XDM) (Second Edition)
- XML Inclusions (XInclude) Version 1.0 (Second Edition)
- XPointer Framework
- XPointer element() Scheme
- XPointer xmlns() Scheme
- Canonical XML Version 1.0
XmlPrime also has support for the following W3C Working Drafts.
- Added an XInclude processor. This is exposed via the XIncludeXIncludeXInclude class. An XInclude command line tool and an MSBuild task is also available.
Added support for
XSLT and XQuery Serialization 3.0.
Specifically, the namespace
http://www.w3.org/2010/xslt-xquery-serializationshould now be used in preference to the XmlPrime-specific
- A new property SuppressIndentationSuppressIndentationSuppressIndentation has been added to XdmWriterSettingsXdmWriterSettingsXdmWriterSettings.
- A new method ParameterDocumentParameterDocumentParameterDocument has been added to XdmWriterSettingsXdmWriterSettingsXdmWriterSettings to enable the reading of serialization parameters from the XML file.
- Added support for the Path attribute in the MSBuild tasks.
- Improved performance of XdmDocumentXdmDocumentXdmDocument.
- Fixed problems with namespace handling.
- Fixed problems with xml:base handling.
- Implemented forthcoming XSLT 2.0 erratum XT.E37.
Changed the behaviour of
namespace-uri-for-prefix('', )following an XQuery Working Group decision.
- Renamed the CDataSectionElementsCollectionCDataSectionElementsCollectionCDataSectionElementsCollection class to XmlQualifiedNameCollectionXmlQualifiedNameCollectionXmlQualifiedNameCollection classes, because it is now used in both CDataSectionElementsCDataSectionElementsCDataSectionElements and SuppressIndentationSuppressIndentationSuppressIndentation.
Overhaul of native module support.
- The set of CLR types allowed for arguments and return types expanded to include all .NET primitive types, and to represent all XQuery types.
- The attribute has been added to give greater control over the signature of exported methods.
- Methods exported in a native module no longer need to be static.
- Added new <xp:script><xp:script><xp:script> element to allow .NET code to be embedded in a stylesheet.
- Added <msxsl:script><msxsl:script><msxsl:script> element for compatibility with XSLT.
- All .NET Encodings are now supported for serialization.
- Added new Xslt.CompileXslt.CompileXslt::Compile overloads to compile a stylesheet from a StreamStreamStream or TextReaderTextReaderTextReader.
- TypedValueTypedValueTypedValue property on XPathAtomicValueXPathAtomicValueXPathAtomicValue now returns the appropriate .NET integer type for all xs:integer subtypes.
- Tail recursion is now be performed in the definitions of variables which are only referenced once in each branch of execution.
- Added case order parameter to URIs for .
- Fixed some exceptions raised during compilation.
- Changed XdmFunctionAttribute.LocalNameXdmFunctionAttribute.LocalNameXdmFunctionAttribute::LocalName and XdmModuleAttribute.TargetNamespaceXdmModuleAttribute.TargetNamespaceXdmModuleAttribute::TargetNamespace into properties
- Removed XdmModule.XsltUseWhenFunctionsXdmModule.XsltUseWhenFunctionsXdmModule::XsltUseWhenFunctions as these were intended for internal use only.
- Removed error codes Anst0001Anst0001Anst0001 and Extn0001Extn0001Extn0001 as these are no longer used.
- Complete support for XSL Transformations (XSLT) 2.0 has been added. See XsltXsltXslt and XsltSettingsXsltSettingsXsltSettings.
- MSBuild Tasks are now provided for invoking XQuery queries and XSL Transformations. See XmlPrime MSBuild Task Library for more information.
- Improved the AnyUriAnyUriAnyUri class. Added the AnyUri.GetComponentsAnyUri.GetComponentsAnyUri::GetComponents method to match Uri.GetComponentsUri.GetComponentsUri::GetComponents.
- Duplicate XML Declarations were being produced when serializing a query whose result is a document node.
- Added XdmDocumentWriterXdmDocumentWriterXdmDocumentWriter class to enable direct serialization to an XdmDocumentXdmDocumentXdmDocument.
- Fixed a bug in the handling of the second argument of MoveToFollowingMoveToFollowingMoveToFollowing of navigators over XdmDocumentXdmDocumentXdmDocument which resulted in incorrect results.
- Fixed a bug in generation of namespace prefixes which caused duplicate namespace declaration to be written.
- Fixed a bug with recursive functions which iterate over range expressions.
- Moved the TypeCheckingModeTypeCheckingModeTypeCheckingMode property to the XPathSettingsXPathSettingsXPathSettings and XQuerySettingsXQuerySettingsXQuerySettings classes, as this is not currently applicable to XSLT.
- Renamed the misspelt function UnparsedEntityPublicDdUnparsedEntityPublicDdUnparsedEntityPublicDd and UnparsedEntitySystemDdUnparsedEntitySystemDdUnparsedEntitySystemDd to UnparsedEntityPublicIdUnparsedEntityPublicIdUnparsedEntityPublicId and UnparsedEntityPublicIdUnparsedEntityPublicIdUnparsedEntityPublicId respectively.
- Removed the Serialize (XmlReader, TextWriter, XdmWriterSettings)Serialize (XmlReader, TextWriter, XdmWriterSettings)Serialize (XmlReader^, TextWriter^, XdmWriterSettings^) method as it is redundant to WriteNodeWriteNodeWriteNode.
- Removed DelegatingXmlReaderDelegatingXmlReaderDelegatingXmlReader as it was accidentally made public in the last release.
- XML version (1.0 or 1.1) can now be specified in the static context.
- Results can now be serialized as XML 1.1.
- Query plans can now be output as XML.
Mathematical functions due to be included in the next version of XPath and XQuery Functions and Operators have been moved into the
- Rules for determining the validity of NCNames and QNames have been updated to reflect changes introduced in the 5th edition of XML 1.0.
- The types of external parameters can be specified via the static context.
- Improved efficiency of variables which are only evaluated once.
- Improved performance of user defined functions.
- Improved performance of functions which recurse on a subsequence of one of their arguments.
forloops will be unrolled.
- Prevented optimizer from optimizing away runtime errors in some circumstances.
- Added handling for MIME types in the DocumentSet. This is required for correct behaviour of the XSLT document function.
- Introduced a new optimization level (OptimizationLevel.Specialization. This enables potentially expensive function specialization. This can be selected using -O4 with the command line tool.
- In some circumstances, namespace declarations could be erroneously omitted.
- Fixed nested XML Schema validation.
- Fixed output of empty XHTML elements during serialization.
- Many small fixes.
- The CreateCreateCreate methods no longer take an XmlNameTableXmlNameTableXmlNameTable argument.
XsltWhitespaceSettingshas been renamed to InputSettingsInputSettingsInputSettings and now also includes input type annotations.
- ResourceResourceResource now returns ResolvedResourceResolvedResourceResolvedResource. Previously, it returned a StreamStreamStream.
Resolvemethod of IDocumentResolverIDocumentResolverIDocumentResolver has been replaced with ResolveDocumentResolveDocumentResolveDocument.
Resolvemethod of ICollectionResolverICollectionResolverICollectionResolver has been replaced with ResolveCollectionResolveCollectionResolveCollection.
Resolvemethod of IResourceResolverIResourceResolverIResourceResolver has been replaced with ResolveResourceResolveResourceResolveResource.
DefaultTypeproperty of IDocumentTypeResolverIDocumentTypeResolverIDocumentTypeResolver has been replaced with DefaultDocumentTypeDefaultDocumentTypeDefaultDocumentType.
Resolvemethod of IDocumentTypeResolverIDocumentTypeResolverIDocumentTypeResolver has been replaced with ResolveDocumentTypeResolveDocumentTypeResolveDocumentType.
DefaultTypeproperty of ICollectionTypeResolverICollectionTypeResolverICollectionTypeResolver has been replaced with DefaultCollectionTypeDefaultCollectionTypeDefaultCollectionType.
Resolvemethod of ICollectionTypeResolverICollectionTypeResolverICollectionTypeResolver has been replaced with ResolveCollectionTypeResolveCollectionTypeResolveCollectionType.
- Modules of functions can now be written in .NET and used in XQuery programs and XPath expressions.
- Intermediate (constructed) nodes are now serialized directly into XdmDocumentXdmDocumentXdmDocument instances, rather than building temporary trees. This should lead to improved performance of queries performing further processing on constructed nodes.
- Some more improvements to join analysis - left outer joins and group-by expressions are spotted (and hence optimized) more often.
typeswitchexpressions are now more efficient when the argument is a single item.
- ToStringToStringToString now returns the value cast to a string.
- Many small fixes.
XmlPrime.XPathLibraryCollectionhas been replaced with LibrarySetLibrarySetLibrarySet.
XmlPrime.XPathFunctionCollectionhas been replaced with XdmModuleXdmModuleXdmModule.
- LocationHintCollectionLocationHintCollectionLocationHintCollection now stores location hints as AnyUriAnyUriAnyUri values rather than stringStringString values.
- CollationResolverCollationResolverCollationResolver now takes an ICollationResolverICollationResolverICollationResolver instead of CollationResolverCollationResolverCollationResolver. CollationResolverCollationResolverCollationResolver still exists and implements ICollationResolverICollationResolverICollationResolver, so this change should have minimal impact.
- The XmlPrime DLL can now be precompiled with ngen. Previously ngen would crash.
- Improved unboxed evaluation, especially for aggregate functions.
- Many small performance improvements.
- Internal changes in preparation for compiling queries to dynamic methods
- Queries can now be evaluated directly to a serializer, avoiding building an intermediate representation.
- Push-based evaluation has been implemented for all expressions, and is used for all expressions that are determined to be strict.
(# xp:eager #)pragma to force eager evaluation.
import schemanow ignores location hints if the namespace is already statically available.
- Imported schemas that fail to compile are no longer added to the available schema set.
Fixed an exception when evaluating
treat as empty-sequence()in some circumstances, and improved optimization of type constraints.
- Corrected behaviour of MoveToIdMoveToIdMoveToId for constructed nodes.
- Updated liveness analysis to fix problems when using partially evaluated lazy variables in join operations.
distinct-doc-orderfor unions such as
- Minor improvements to error messages.
- Many small performance improvements.
Completely new serialization implementation.
- Serialization interface now much closer to XmlWriterXmlWriterXmlWriter. There are some breaking API changes in the XmlPrime.SerializationXmlPrime.SerializationXmlPrime.Serialization namespace.
- A new serialization method has been added which allows for serialization of Canonical XML 1.0.
- XmlWriterXmlWriterXmlWriter instances can be created with the full set of serialization settings.
- Some new serialization parameters have been added.
- XmlPrime now only requires .NET Framework 2.0, rather than 3.5.
- Added XmlPrime extension methods for .NET Framework 3.5 to give a simple way of executing XPath 2.0 expressions.
- Added some more constructors to XdmDocumentXdmDocumentXdmDocument, to match XPathDocumentXPathDocumentXPathDocument.
- Removed IXPathNavigableIXPathNavigableIXPathNavigable overloads for methods taking XPathItemXPathItemXPathItem, as this was causing calls with XPathNavigatorXPathNavigatorXPathNavigator to be ambiguous.
Reverse axes were previously being cached and reversed. This is now skipped if the results are not needed in document order - eg. for
Improved optimization of
fn:dataapplied to constructed nodes.
- Conformance to latest errata regarding in-scope schema types from modules.
- XQuery parsing changed to reflect erratum regarding the leading-lone-slash constraint.
- The order comparison of navigators over XdmDocumentXdmDocumentXdmDocument instances was incorrect for namespace nodes.
fn:node-namefunctions behaved incorrectly for namespace node arguments.
- The parsing of URI ports was incorrect in AnyUriAnyUriAnyUri.
- The UserInfoUserInfoUserInfo property was truncating the first character
- Empty document nodes were incorrectly causing spaces to be inserted between sequences of atomic values when constructing an element's content
- XPathNavigatorXPathNavigatorXPathNavigator instances were sometimes not being cloned when evaluating a query to a single node, leading to the returned navigator pointing to the wrong node.
- Fixed some places where the static types of expressions were not being correctly updated during optimization, causing a NotSupportedExceptionNotSupportedExceptionNotSupportedException or ArgumentNullExceptionArgumentNullExceptionArgumentNullException at runtime.
In some cases function specialization was causing
fn:subsequenceto throw a NotSupportedExceptionNotSupportedExceptionNotSupportedException at runtime.
The optimized form of
fn:sum($x to $y)was producing
xs:decimalvalues instead of
fn:distinct-valueswas missing an evaluator to produce XPathItemXPathItemXPathItem for upstream functions, leading to a NotSupportedExceptionNotSupportedExceptionNotSupportedException at runtime.
- The in-scope namespaces of a constructed element did not include the empty prefix in some situations.
fn:element-with-idfunction gave incorrect results for schema-defined union types including
- Set default type checking mode to optimistic, as per documentation.
Fixed compatibility with XmlDocumentXmlDocumentXmlDocument
Fixed NullReferenceExceptionNullReferenceExceptionNullReferenceException when using
fn:data()caused by XmlDocumentXmlDocumentXmlDocument returning an IXmlSchemaInfoIXmlSchemaInfoIXmlSchemaInfo instance with null SchemaTypeSchemaTypeSchemaType.
Fixed infinite loop caused by an XPathNodeIteratorXPathNodeIteratorXPathNodeIterator over XmlDocumentXmlDocumentXmlDocuments not consistantly returning
falseafter the end of the node set.
- Fixed the XQuery version declaration for cultures where '.' is not the decimal point.
- Fixed normalization rules of general comparisons as per erratum XQ.E18.
- Fixed NullReferenceExceptionNullReferenceExceptionNullReferenceException when using
- For increased performance, the command line tool now runs in x86 mode by default.
- First full release.