XmlPrime 2.7
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.
Implemented standards
XmlPrime implements the following W3C Recmmendations.
- XQuery 1.0: An XML Query Language (Second Edition)
- XQuery Update Facility 1.0
- 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 and Candidate Recommendations.
Change log
Version 2.7.0
- Added support LEIRI and IRIs to AnyUriAnyUriAnyUri.
- Added properties IsAbsoluteIsAbsoluteIsAbsolute and IsOpaqueIsOpaqueIsOpaque to AnyUriAnyUriAnyUri.
- Added method CallInitialTemplateCallInitialTemplateCallInitialTemplate to XsltXsltXslt.
- Fixed recursive calls to methods performing join operations.
- Fixed a number of issues relating to the namespace axis.
-
Improved conformance of
format-number
,format-integer
,parse-xml
andparse-xml-fragment
functions. - Fixed loop invariant hoisting around general comparisons.
- Fixed a null reference exception in schema validation.
-
Fixed parsing of
xsl:result-document
attributes and whitespace in XSLT stylesheets. - Fixed handling of strip/prevserve space to apply to child whitespace only.
- Fixed handling of xsl:keys from XSLT 1.0 and 2.0 stylesheets.
- Corrected the setting of the Base URI on the document node of results produced with xsl:result-document.
- Improved restrictions on permissable values for the BaseOutputURIBaseOutputURIBaseOutputURI property.
- Numerous other bug fixes.
Version 2.6.0
-
Added support for
msxsl:node-set
. -
Added support for
html-version
serialization parameter to specify generation of HTML5. - Fixed bugs relating to use of the <msxsl:script> and <xp:script> XSLT extension elements.
- Fixed handling of schema-elements and substitution groups (Bug 19425)..
- Improved conformance for Functions and Operators 3.0.
- Numerous other bug fixes.
Version 2.5.0
- XmlPrime no longer requires the use of a single name table.
- Fixed bugs relating to use of the <msxsl:script> and <xp:script> XSLT extension elements.
- Permit use of Nullable<T>Nullable(Of T)Nullable<T> in native functions in scripts in <xp:script>.
-
The XSLT
disable-output-escaping
attribute is now respected when serializing to a StreamStreamStream or TextWriterTextWriterTextWriter. - Permit use of scripts as XQuery modules.
- Improved reporting of errors during the import of native functions.
- Added properties DefaultLanguageDefaultLanguageDefaultLanguage, DefaultCalendarDefaultCalendarDefaultCalendar and DefaultPlaceDefaultPlaceDefaultPlace to the DynamicContextSettingsDynamicContextSettingsDynamicContextSettings.
- Improved conformance.
- Improved compilation speed.
- Numerous other bug fixes.
Breaking Changes:
- Removed class XPathItemCollectionXPathItemCollectionXPathItemCollection. Methods previously returning this class now return IEnumerable<T>IEnumerable(Of T)IEnumerable<T> collections of XPathItemXPathItemXPathItem.
-
Removed property UsePrivateNameTableUsePrivateNameTableUsePrivateNameTable.
Because it is no longer a requirement to use a single XmlNameTableXmlNameTableXmlNameTable a private
XmlNameTableXmlNameTableXmlNameTable is always used. To continue to use a
SharedDocumentSetSharedDocumentSetSharedDocumentSet (which was a side effect of setting
UsePrivateNameTableUsePrivateNameTableUsePrivateNameTable to
true
), set the DocumentSetDocumentSetDocumentSet to use a SharedDocumentSetSharedDocumentSetSharedDocumentSet instance explicitly. See ShareDocumentSet ()ShareDocumentSet ()ShareDocumentSet (). - Added property EnableScriptEnableScriptEnableScript to XsltSettingsXsltSettingsXsltSettings which must be explicity set to permit use of the <msxsl:script> and <xp:script> XSLT extension elements.
- Added property EnableScriptEnableScriptEnableScript to XQuerySettingsXQuerySettingsXQuerySettings which must be explicity set to permit import of script modules.
Version 2.4.0
-
XmlPrime now supports the functions defined in
XPath and XQuery Functions and Operators 3.0
(W3C Working Draft 13 December 2011). Note that the W3C XQuery and XSLT Working Groups have agreed changes to this specification
since its publication, and there are some outstanding bug reports against this specification. In particular, the implementation of
fn:format-integer
differs from the Working Draft. - Added member NewlineNormalizationNewlineNormalizationNewlineNormalization to XPathSettingsXPathSettingsXPathSettings in response to the resolution of Bug 14917 (Normalization of line endings in XPath).
- Added member XPathVersionXPathVersionXPathVersion to XPathSettingsXPathSettingsXPathSettings in preparation for XPath 3.0. Note that only XPath20XPath20XPath20 is supported in this release.
- Added member XQueryVersionXQueryVersionXQueryVersion to XQuerySettingsXQuerySettingsXQuerySettings in preparation for XQuery 3.0. Note that only XQuery30XQuery30XQuery30 is supported in this release.
-
Added member
AvailableEnvironmentVariablesAvailableEnvironmentVariablesAvailableEnvironmentVariables to
DynamicContextSettingsDynamicContextSettingsDynamicContextSettings to provide environment variables via the
Functions and Operators 3.0
fn:available-environment-variables
andfn:environment-variable
functions. - Fixed issues with rounding of floating point numbers in fn:format-number.
- Fixed an optimization error in function inlining when the function arguments create new nodes.
- Fixed an error typeswitch expressions which caused text() not to match whitespace text nodes.
- Fixed parsing of IPv6 addresses in AnyUriAnyUriAnyUri.
- Fixed a bug in the matching of regular expressions which contain patterns of the form (group)+ and (group)*.
- Fixed a bug in the computation of in-scope namespaces of constructed elements.
- Fixed the checking of the encoding declaration against the text encoding of the underlying TextReaderTextReaderTextReader which was incorrectly checking against the encoding's EncodingNameEncodingNameEncodingName instead of its WebNameWebNameWebName.
Breaking Changes:
- Renamed the XQuery11FunctionsXQuery11FunctionsXQuery11Functions member of class XdmModuleXdmModuleXdmModule to XQuery30FunctionsXQuery30FunctionsXQuery30Functions to reflect change in XQuery and XPath specification numbering.
Version 2.3.0
- Added support for the XQuery Update Facility 1.0. This is exposed via the XQueryXQueryXQuery class and can also be used in the XQuery command line tool and an MSBuild task is also available.
- Fixed a bug triggered by optimization which caused incorrect results.
Breaking Changes:
- Made IResultDocumentHandlerIResultDocumentHandlerIResultDocumentHandler derive from IDisposableIDisposableIDisposable and added CompleteCompleteComplete method.
Version 2.2.0
- 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-serialization
should now be used in preference to the XmlPrime-specifichttp://www.xmlprime.com/serialization
namespace. - 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.
Breaking Changes:
- Renamed the CDataSectionElementsCollectionCDataSectionElementsCollectionCDataSectionElementsCollection class to XmlQualifiedNameCollectionXmlQualifiedNameCollectionXmlQualifiedNameCollection classes, because it is now used in both CDataSectionElementsCDataSectionElementsCDataSectionElements and SuppressIndentationSuppressIndentationSuppressIndentation.
Version 2.1.0
-
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.
Breaking Changes:
- 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.
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 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.
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
(# xmlprime: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.