XmlPrime 2.0
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 and XPath 2.0.
Implemented standards
XmlPrime implements the following W3C standards.
- 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)
- Canonical XML Version 1.0
Change log
Version 2.0.0
- 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.
Breaking Changes:
-
Moved the
StaticContextSettings.TypeCheckingMode
property to the XPathSettingsXPathSettingsXPathSettings and XQuerySettingsXQuerySettingsXQuerySettings classes, as this is not currently applicable to XSLT. -
Renamed the misspelt function
XdmNavigator.UnparsedEntityPublicDd
andXdmNavigator.UnparsedEntitySystemDd
to UnparsedEntityPublicIdUnparsedEntityPublicIdUnparsedEntityPublicId and UnparsedEntityPublicIdUnparsedEntityPublicIdUnparsedEntityPublicId respectively. -
Removed the
M:XmlPrime.Serialization.XdmWriter.Serialize(System.Xml.XmlReader,System.IO.TextWriter,XmlPrime.Serialization.XdmWriterSettings)
method as it is redundant to WriteNodeWriteNodeWriteNode. -
Removed
T:XmlPrime.DelegatingXmlReader
as it was accidentally made public in the last release.
Version 1.5.0
- 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
math
namespace. - 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.
-
Small
for
loops 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.
Breaking changes
- The CreateCreateCreate methods no longer take an XmlNameTableXmlNameTableXmlNameTable argument.
-
XsltWhitespaceSettings
has been renamed to InputSettingsInputSettingsInputSettings and now also includes input type annotations. - ResourceResourceResource now returns ResolvedResourceResolvedResourceResolvedResource. Previously, it returned a StreamStreamStream.
-
The
Resolve
method of IDocumentResolverIDocumentResolverIDocumentResolver has been replaced with ResolveDocumentResolveDocumentResolveDocument. -
The
Resolve
method of ICollectionResolverICollectionResolverICollectionResolver has been replaced with ResolveCollectionResolveCollectionResolveCollection. -
The
Resolve
method of IResourceResolverIResourceResolverIResourceResolver has been replaced with ResolveResourceResolveResourceResolveResource. -
The
DefaultType
property of IDocumentTypeResolverIDocumentTypeResolverIDocumentTypeResolver has been replaced with DefaultDocumentTypeDefaultDocumentTypeDefaultDocumentType. -
The
Resolve
method of IDocumentTypeResolverIDocumentTypeResolverIDocumentTypeResolver has been replaced with ResolveDocumentTypeResolveDocumentTypeResolveDocumentType. -
The
DefaultType
property of ICollectionTypeResolverICollectionTypeResolverICollectionTypeResolver has been replaced with DefaultCollectionTypeDefaultCollectionTypeDefaultCollectionType. -
The
Resolve
method of ICollectionTypeResolverICollectionTypeResolverICollectionTypeResolver has been replaced with ResolveCollectionTypeResolveCollectionTypeResolveCollectionType.
Version 1.4.0
- 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.
-
typeswitch
expressions are now more efficient when the argument is a single item. - ToStringToStringToString now returns the value cast to a string.
- Many small fixes.
Breaking changes
-
XmlPrime.XPathLibraryCollection
has been replaced with LibrarySetLibrarySetLibrarySet. -
XmlPrime.XPathFunctionCollection
has 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.
Version 1.3.0
- 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
Version 1.2.0
- 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.
-
Added the
(# xp:eager #)
pragma to force eager evaluation. -
import schema
now 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.
-
Avoided
distinct-doc-order
for unions such as(@*|node())
. - Minor improvements to error messages.
- Many small performance improvements.
Version 1.1.0
-
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
/ancestor::*[1]
-
Improved optimization of
fn:data
applied to constructed nodes. - Conformance to latest errata regarding in-scope schema types from modules.
-
Bug fixes:
- 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.
-
The
fn:base-uri
,fn:data
andfn:node-name
functions 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:subsequence
to throw a NotSupportedExceptionNotSupportedExceptionNotSupportedException at runtime. -
The optimized form of
fn:sum($x to $y)
was producingxs:decimal
values instead ofxs:integer
values. -
fn:distinct-values
was 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.
-
The
fn:element-with-id
function gave incorrect results for schema-defined union types includingxs:ID
.
Version 1.0.2
- 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
false
after 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.
Version 1.0.1
- First full release.