/** * An internal key definition is used to support the idref() function. The key definition * is equivalent to xsl:key match="element(*, xs:IDREF) | element(*, IDREFS) | * attribute(*, xs:IDREF) | attribute(*, IDREFS)" use=".". This method creates this * key definition. * @param config The configuration. This is needed because the patterns that are * generated need access to schema information. */ private void registerIdrefKey(Configuration config) { PatternFinder idref = IdrefTest.getInstance(); //Expression eval = new Atomizer(new ContextItemExpression(), config); StringFn sf = (StringFn)SystemFunction.makeSystemFunction( "string", new Expression[]{new ContextItemExpression()}); StringLiteral regex = new StringLiteral("\\s+"); Tokenize use = (Tokenize)SystemFunction.makeSystemFunction("tokenize", new Expression[]{sf, regex}); KeyDefinition key = new KeyDefinition(idref, use, null, null); key.setIndexedItemType(BuiltInAtomicType.STRING); try { addKeyDefinition(StandardNames.getStructuredQName(StandardNames.XS_IDREFS), key, config); } catch (XPathException err) { throw new AssertionError(err); // shouldn't happen } }
/** * An internal key definition is used to support the idref() function. The key definition * is equivalent to xsl:key match="element(*, xs:IDREF) | element(*, IDREFS) | * attribute(*, xs:IDREF) | attribute(*, IDREFS)" use=".". This method creates this * key definition. * @param config The configuration. This is needed because the patterns that are * generated need access to schema information. */ private void registerIdrefKey(Configuration config) { PatternFinder idref = IdrefTest.getInstance(); Expression eval = new Atomizer(new ContextItemExpression(), config); StringLiteral regex = new StringLiteral("\\s"); Tokenize use = (Tokenize)SystemFunction.makeSystemFunction("tokenize", new Expression[]{eval, regex}); KeyDefinition key = new KeyDefinition(idref, use, null, null); key.setIndexedItemType(BuiltInAtomicType.STRING); try { addKeyDefinition(StandardNames.getStructuredQName(StandardNames.XS_IDREFS), key, config); } catch (XPathException err) { throw new AssertionError(err); // shouldn't happen } }
/** * An internal key definition is used to support the idref() function. The key definition * is equivalent to xsl:key match="element(*, xs:IDREF) | element(*, IDREFS) | * attribute(*, xs:IDREF) | attribute(*, IDREFS)" use=".". This method creates this * key definition. * @param config The configuration. This is needed because the patterns that are * generated need access to schema information. */ private void registerIdrefKey(Configuration config) { PatternFinder idref = IdrefTest.getInstance(); Expression eval = new Atomizer(new ContextItemExpression(), config); StringLiteral regex = new StringLiteral("\\s"); Tokenize use = (Tokenize)SystemFunction.makeSystemFunction("tokenize", new Expression[]{eval, regex}); KeyDefinition key = new KeyDefinition(idref, use, null, null); key.setIndexedItemType(BuiltInAtomicType.STRING); try { addKeyDefinition(StandardNames.getStructuredQName(StandardNames.XS_IDREFS), key, config); } catch (XPathException err) { throw new AssertionError(err); // shouldn't happen } }