Package net.sf.saxon.value

Examples of net.sf.saxon.value.StringValue


  public Value atomize() {
    switch (getNodeKind()) {
      case Type.COMMENT:
      case Type.PROCESSING_INSTRUCTION:
        return new StringValue(getStringValueCS());
      default:
        return new UntypedAtomicValue(getStringValueCS());
    }
  }
View Full Code Here


     * @throws XPathException
     */

    private StringCollator getCollator(XPathContext context) throws XPathException {
        if (collationNameExpression != null) {
            StringValue collationValue = (StringValue)collationNameExpression.evaluateItem(context);
            String cname = collationValue.getStringValue();
            URI collationURI;
            try {
                collationURI = new URI(cname);
                if (!collationURI.isAbsolute()) {
                    if (baseURI == null) {
View Full Code Here

                public SequenceIterator<? extends Item> call(SequenceIterator<? extends Item>[] sequenceIterators, XPathContext xPathContext) throws XPathException {
                    Item arg1 = sequenceIterators[0].next();
                    String arg1Val = arg1.getStringValue();

                    // return a altered version of the first arg
                    StringValue sv = new StringValue("arg1[" + arg1Val + "]");
                    return SingletonIterator.makeIterator(sv);
                }
            };
        }
View Full Code Here

                    // get value of first arg passed to the function
                    Item arg1 = sequences[0].head();
                    String arg1Val = arg1.getStringValue();

                    // return a altered version of the first arg
                    return new StringValue("arg1[" + arg1Val + "]");
                }
            };
        }
View Full Code Here

         } else if (source instanceof Float) {
             result = new FloatValue((Float)source);
         } else if (source instanceof BigDecimal) {
             result = new DecimalValue((BigDecimal)source);
         } else if (source instanceof String) {
             result = new StringValue(((String)source));
         } else {
             result = new ObjectValue(source);
         }

        return result;
View Full Code Here

         } else if (source instanceof Float) {
             result = new FloatValue((Float)source);
         } else if (source instanceof BigDecimal) {
             result = new DecimalValue((BigDecimal)source);
         } else if (source instanceof String) {
             result = new StringValue(((String)source));
         } else {
             result = new ObjectValue(source);
         }

        return result;
View Full Code Here

        } else if (source instanceof Float) {
            result = new FloatValue((Float)source);
        } else if (source instanceof BigDecimal) {
            result = new DecimalValue((BigDecimal)source);
        } else if (source instanceof String) {
            result = new StringValue(((String)source));
        } else {
            result = new ObjectValue(source);
        }

        return result;
View Full Code Here

        AtomicValue av1 = (AtomicValue)argument[0].evaluateItem(context);
        long arity = -1;
        if (argument.length == 2) {
            arity = ((NumericValue)argument[1].evaluateItem(context)).longValue();
        }
        StringValue nameValue = (StringValue)av1;
        String lexicalName = nameValue.getStringValue();
        StructuredQName qName;
        try {
            if (lexicalName.indexOf(':') < 0) {
                // we're in XSLT, where the default namespace for functions can't be changed
                String uri = (operation == FUNCTION_AVAILABLE
View Full Code Here

        AtomicValue av = (AtomicValue)argument[0].evaluateItem(context);
        if (av==null) {
            return StringValue.EMPTY_STRING;
        }
        StringValue sv = (StringValue)av;
        if (sv.isZeroLength()) {
            return StringValue.EMPTY_STRING;
        }

        AtomicValue a1 = (AtomicValue)argument[1].evaluateItem(context);
        NumericValue a = (NumericValue)a1;

        if (argument.length==2) {
            StringValue result = StringValue.makeStringValue(substring(sv, a));
            if (sv.isKnownToContainNoSurrogates()) {
                result.setContainsNoSurrogates();
            }
            return result;
        } else {
            AtomicValue b2 = (AtomicValue)argument[2].evaluateItem(context);
            NumericValue b = (NumericValue)b2;
            StringValue result = StringValue.makeStringValue(substring(sv, a, b, context));
            if (sv.isKnownToContainNoSurrogates()) {
                result.setContainsNoSurrogates();
            }
            return result;
        }
    }
View Full Code Here

    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:
View Full Code Here

TOP

Related Classes of net.sf.saxon.value.StringValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.