/** * Get the typed value of the node * @return an iterator over the items making up the typed value */ public SequenceIterator getTypedValue() throws XPathException { switch (getNodeKind()) { case Type.COMMENT: case Type.PROCESSING_INSTRUCTION: return SingletonIterator.makeIterator(new StringValue(stringValue)); case Type.TEXT: case Type.DOCUMENT: case Type.NAMESPACE: return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue)); default: if (typeAnnotation == -1 || typeAnnotation == StandardNames.XS_UNTYPED || typeAnnotation == StandardNames.XS_UNTYPED_ATOMIC) { return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue)); } else { SchemaType stype = config.getSchemaType(typeAnnotation); if (stype == null) { String typeName = config.getNamePool().getDisplayName(typeAnnotation); throw new IllegalStateException("Unknown type annotation " + Err.wrap(typeName) + " in standalone node"); } else { return stype.getTypedValue(this); } } } }
/** * Get the typed value of the item */ public SequenceIterator getTypedValue() throws XPathException { switch (getNodeKind()) { case Type.COMMENT: case Type.PROCESSING_INSTRUCTION: return SingletonIterator.makeIterator(new StringValue(stringValue)); case Type.TEXT: case Type.DOCUMENT: case Type.NAMESPACE: return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue)); default: if (typeAnnotation == -1 || typeAnnotation == StandardNames.XS_UNTYPED || typeAnnotation == StandardNames.XS_UNTYPED_ATOMIC) { return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue)); } else { SchemaType stype = config.getSchemaType(typeAnnotation); if (stype == null) { String typeName = config.getNamePool().getDisplayName(typeAnnotation); throw new IllegalStateException("Unknown type annotation " + Err.wrap(typeName) + " in standalone node"); } else { return stype.getTypedValue(this); } } } }
/** * Get the typed value of the item */ public SequenceIterator getTypedValue() throws XPathException { switch (getNodeKind()) { case Type.COMMENT: case Type.PROCESSING_INSTRUCTION: return SingletonIterator.makeIterator(new StringValue(stringValue)); case Type.TEXT: case Type.DOCUMENT: case Type.NAMESPACE: return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue)); default: if (typeAnnotation == -1 || typeAnnotation == StandardNames.XS_UNTYPED || typeAnnotation == StandardNames.XS_UNTYPED_ATOMIC) { return SingletonIterator.makeIterator(new UntypedAtomicValue(stringValue)); } else { SchemaType stype = config.getSchemaType(typeAnnotation); if (stype == null) { String typeName = config.getNamePool().getDisplayName(typeAnnotation); throw new IllegalStateException("Unknown type annotation " + Err.wrap(typeName) + " in standalone node"); } else { return stype.getTypedValue(this); } } } }
/** * Get the typed value of this node. * If there is no type annotation, we return the string value, as an instance * of xs:untypedAtomic */ public SequenceIterator getTypedValue() throws XPathException { int annotation = getTypeAnnotation(); if ((annotation & NodeInfo.IS_DTD_TYPE) != 0) { annotation = StandardNames.XS_UNTYPED_ATOMIC; } annotation &= NamePool.FP_MASK; if (annotation == -1 || annotation == StandardNames.XS_UNTYPED_ATOMIC || annotation == StandardNames.XS_UNTYPED) { return SingletonIterator.makeIterator(new UntypedAtomicValue(getStringValueCS())); } else { SchemaType stype = getConfiguration().getSchemaType(annotation); if (stype == null) { String typeName; try { typeName = getNamePool().getDisplayName(annotation); } catch (Exception err) { typeName = annotation + ""; } throw new XPathException("Unknown type annotation " + Err.wrap(typeName) + " in document instance"); } else { return stype.getTypedValue(this); } } }
/** * Get the typed value of this node. * If there is no type annotation, we return the string value, as an instance * of xs:untypedAtomic */ public SequenceIterator getTypedValue() throws XPathException { int annotation = getTypeAnnotation(); if ((annotation & NodeInfo.IS_DTD_TYPE) != 0) { annotation = StandardNames.XS_UNTYPED_ATOMIC; } annotation &= NamePool.FP_MASK; if (annotation == -1 || annotation == StandardNames.XS_UNTYPED_ATOMIC || annotation == StandardNames.XS_UNTYPED) { return SingletonIterator.makeIterator(new UntypedAtomicValue(getStringValueCS())); } else { SchemaType stype = getConfiguration().getSchemaType(annotation); if (stype == null) { String typeName; try { typeName = getNamePool().getDisplayName(annotation); } catch (Exception err) { typeName = annotation + ""; } throw new XPathException("Unknown type annotation " + Err.wrap(typeName) + " in document instance"); } else { return stype.getTypedValue(this); } } }
/** * Get the typed value of this node. * If there is no type annotation, we return the string value, as an instance * of xs:untypedAtomic */ public SequenceIterator getTypedValue() throws XPathException { int annotation = getTypeAnnotation(); if ((annotation & NodeInfo.IS_DTD_TYPE) != 0) { annotation = StandardNames.XS_UNTYPED_ATOMIC; } annotation &= NamePool.FP_MASK; if (annotation == -1 || annotation == StandardNames.XS_UNTYPED_ATOMIC || annotation == StandardNames.XS_UNTYPED) { return SingletonIterator.makeIterator(new UntypedAtomicValue(getStringValueCS())); } else { SchemaType stype = getConfiguration().getSchemaType(annotation); if (stype == null) { String typeName; try { typeName = getNamePool().getDisplayName(annotation); } catch (Exception err) { typeName = annotation + ""; } throw new XPathException("Unknown type annotation " + Err.wrap(typeName) + " in document instance"); } else { return stype.getTypedValue(this); } } }
/** * Get the typed value of this node. * If there is no type annotation, we return the string value, as an instance * of xs:untypedAtomic */ public SequenceIterator getTypedValue() throws XPathException { int annotation = getTypeAnnotation(); if ((annotation & NodeInfo.IS_DTD_TYPE) != 0) { annotation = StandardNames.XS_UNTYPED_ATOMIC; } annotation &= NamePool.FP_MASK; if (annotation == -1 || annotation == StandardNames.XS_UNTYPED_ATOMIC || annotation == StandardNames.XS_UNTYPED) { return SingletonIterator.makeIterator(new UntypedAtomicValue(getStringValueCS())); } else { SchemaType stype = getConfiguration().getSchemaType(annotation); if (stype == null) { String typeName; try { typeName = getNamePool().getDisplayName(annotation); } catch (Exception err) { typeName = annotation + ""; } throw new XPathException("Unknown type annotation " + Err.wrap(typeName) + " in document instance"); } else { return stype.getTypedValue(this); } } }