Difference Between Feature and FeatureKeys.
Added by Sathya Selva about 5 years ago
What is the Difference Between Feature and FeatureKeys. Where we use the Feature and FeatureKeys. Thanks in advance...
Capture.JPGs.JPG (25.9 KB) Capture.JPGs.JPG |
Replies (2)
RE: Difference Between Feature and FeatureKeys. - Added by Martin Honnen about 5 years ago
I think with 9.9 you should use http://saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/Processor.html#setConfigurationProperty-net.sf.saxon.lib.Feature-T- with http://saxonica.com/html/documentation/javadoc/net/sf/saxon/lib/Feature.html, the docs say: "introduced to give a faster and type-safe alternative".
RE: Difference Between Feature and FeatureKeys. - Added by Michael Kay about 5 years ago
FeatureKeys are strings, and are retained (a) for backwards compatibility, and (b) for use in interfaces where configuration parameters can only be supplied as strings.
The Feature object is new in 9.9, and makes FeatureKeys obsolescent. The advantage is (a) they are type-safe, because the type is parameterized with the expected type of the value, and (b) they are faster to look up; previously we were doing a lot of comparisons of lengthy strings to check if a particular option is set, and this showed up in some performance profiles.
Please register to reply