key() resolves its index against the current node's own document, built lazily per document root, so keys work inside document() trees; a node-set use expression indexes the matched node under every member's string value; and key() results return in document order regardless of lookup value order. Xalan baseline 187 -> 182.
16 lines
600 B
Swift
16 lines
600 B
Swift
extension PureXML.XSLT {
|
|
/// The key indexes a transform has built, one per document root.
|
|
final class KeyIndexCache {
|
|
var indexes: [ObjectIdentifier: KeyIndex] = [:]
|
|
}
|
|
|
|
/// The documents a transform has loaded, keyed by URI: per the XSLT
|
|
/// `document()` definition the same reference returns the identical
|
|
/// document, so node identity (and `generate-id()`) is stable across
|
|
/// calls within one transform.
|
|
final class DocumentCache {
|
|
var trees: [String: PureXML.Model.TreeNode] = [:]
|
|
var sources: [String: PureXML.Model.Node] = [:]
|
|
}
|
|
}
|