Package net.sf.saxon.value

Examples of net.sf.saxon.value.AnyURIValue


    public Expression preEvaluate(ExpressionVisitor visitor) throws XPathException {
        String baseURI = visitor.getStaticContext().getBaseURI();
        if (baseURI == null) {
            return Literal.makeEmptySequence();
        }
        return Literal.makeLiteral(new AnyURIValue(baseURI));
    }
View Full Code Here


        }

        Platform platform = Configuration.getPlatform();
        try {
            URI resolved = platform.makeAbsolute(relative,  base);
            return new AnyURIValue(resolved.toString());
        } catch (URISyntaxException err) {
            dynamicError("Base URI " + Err.wrap(base) + " is invalid: " + err.getMessage(),
                    "FORG0002", context);
            return null;
        }
View Full Code Here

                    err.setErrorCode("FODC0004");
                    err.setXPathContext(context);
                    throw err;
                }
                if (finalStable) {
                    return new AnyURIValue(uri);
                } else {
                    // stability not required, bypass the document pool and URI resolver
                    return context.getConfiguration().buildDocument(new StreamSource(uri));
                }
            }
View Full Code Here

            case NAMESPACE_URI:
                String uri = node.getURI();
                s = (uri==null ? "" : uri);
                        // null should no longer be returned, but the spec has changed, so it's
                        // better to be defensive
                return new AnyURIValue(s);

            case GENERATE_ID:
                FastStringBuffer buffer = new FastStringBuffer(16);
                node.generateId(buffer);
                return new StringValue(buffer);

            case DOCUMENT_URI:
                // If the node is in the document pool, get the URI under which it is registered.
                // Otherwise, return its systemId.
                if (node.getNodeKind() == Type.DOCUMENT) {
                    DocumentPool pool = c.getController().getDocumentPool();
                    String docURI = pool.getDocumentURI(node);
                    if (docURI == null) {
                        docURI = node.getSystemId();
                    }
                    if (docURI == null) {
                        return null;
                    } else if ("".equals(docURI)) {
                        return null;
                    } else {
                        return new AnyURIValue(docURI);
                    }
                } else {
                    return null;
                }
            case NODE_NAME:
View Full Code Here

            // Michael Kay's done the heavy lifting and made the method public, so let's just
            // do that!
            try {
                URI abs = net.sf.saxon.functions.ResolveURI.makeAbsolute(relativeURI, baseURI);
                String resolvedURI = abs.toASCIIString();
                return new AnyURIValue(resolvedURI);
            } catch (URISyntaxException use) {
                throw new XProcException(use);
            }
        }
View Full Code Here

            }

            // In 0.9.20, I removed the trailing slash from cwd().
            // The community didn't like that, so I put it back.
            String cwd = runtime.getStaticBaseURI().toASCIIString();
            return new AnyURIValue(cwd);
        }
View Full Code Here

                NodeInfo item = (NodeInfo) xPathContext.getContextItem();
                baseURI = item.getBaseURI();
            }

            if (baseURI == null) {
                return new AnyURIValue("");
            }

            return new AnyURIValue(baseURI);
        }
View Full Code Here

      public Sequence call(XPathContext context, @SuppressWarnings("rawtypes") Sequence[] arguments) throws XPathException
      {
        if (context.getContextItem() instanceof NodeInfo)
        {
          return new SystemIdSequence(new AnyURIValue(((NodeInfo) context.getContextItem()).getSystemId()));
        }
        throw new XPathException("Unexpected XPath context for saxon:line-number");
      }
    };
  }
View Full Code Here

TOP

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

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.