/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: Key.java,v 1.6 2006/04/25 02:25:08 jeffsuttor Exp $
*/
/**
* @author Morten Jorgensen
* @author Santiago Pericas-Geertsen
*/
/**
* The name of this key as defined in xsl:key.
*/
/**
* The pattern to match starting at the root node.
*/
/**
* The expression that generates the values for this key.
*/
/**
* The type of the _use expression.
*/
/**
* Parse the <xsl:key> element and attributes
* @param parser A reference to the stylesheet parser
*/
// Get the required attributes and parser XPath expressions
}
// Parse key name and add to symbol table
// Make sure required attribute(s) have been set
return;
}
return;
}
return;
}
}
/**
* Returns a String-representation of this key's name
* @return The key's name (from the <xsl:key> elements 'name' attribute).
*/
}
// Type check match pattern
// Cast node values to string values (except for nodesets)
if (_useType instanceof StringType == false &&
_useType instanceof NodeSetType == false)
{
}
}
/**
* This method is called if the "use" attribute of the key contains a
* node set. In this case we must traverse all nodes in the set and
* create one entry in this key's index for each node in the set.
*/
int buildKeyIndex) {
// DOM.getStringValueX(nodeIndex) => String
"(I)"+STRING_SIG);
"getNodeIdent",
"(I)"+NODE_SIG);
// AbstractTranslet.SetKeyIndexDom(name, Dom) => void
"setKeyIndexDom",
// This variable holds the id of the node we found with the "match"
// attribute of xsl:key. This is the id we store, with the value we
// get from the nodes we find here, in the index for this key.
final LocalVariableGen parentNode =
// Get the 'parameter' from the stack and store it in a local var.
// Save current node and current iterator on the stack
// Overwrite current iterator with one that gives us only what we want
// Prepare to call buildKeyIndex(String name, int node, String value);
// Now get the node value and push it on the parameter stack
// Finally do the call to add an entry in the index for this key.
// Restore current node and current iterator from the stack
}
/**
* Gather all nodes that match the expression in the attribute "match"
* and add one (or more) entries in this key's index.
*/
// AbstractTranslet.buildKeyIndex(name,node_id,value) => void
"buildKeyIndex",
// AbstractTranslet.SetKeyIndexDom(name, Dom) => void
"setKeyIndexDom",
"getNodeIdent",
"(I)"+NODE_SIG);
// DOM.getAxisIterator(root) => NodeIterator
"getAxisIterator",
"(I)"+NODE_ITERATOR_SIG);
// Get an iterator for all nodes in the DOM
// Reset the iterator to start with the root node
// Loop for traversing all nodes in the DOM
// Check if the current node matches the pattern in "match"
// If this is a node-set we must go through each node in the set
if (_useType instanceof NodeSetType) {
// Pass current node as parameter (we're indexing on that node)
}
else {
}
// Get the next node from the iterator and do loop again...
// Restore current node and current iterator from the stack
}
}