Package net.sf.saxon.om

Examples of net.sf.saxon.om.StructuredQName


            if (!reported) {
                // Hey, no one reported this exception. We better do it.
                treeWriter.addStartElement(c_error);

                String message = xe.getMessage();
                StructuredQName qCode = null;

                if (xe instanceof XPathException) {
                    XPathException xxx = (XPathException) xe;
                    qCode = xxx.getErrorCodeQName();

                    Throwable underlying = xe.getCause();
                    if (underlying != null) {
                        message = underlying.toString();
                    }
                }

                if (xe instanceof XProcException) {
                    XProcException xxx = (XProcException) xe;
                    QName code = xxx.getErrorCode();
                    message = xxx.getMessage();
                    Throwable underlying = xe.getCause();
                    if (underlying != null) {
                        message = underlying.getMessage();
                    }
                    if (code != null) {
                        qCode = new StructuredQName(code.getPrefix(), code.getNamespaceURI(), code.getLocalName());
                    }
                }

                if (qCode != null) {
                    treeWriter.addNamespace(qCode.getPrefix(), qCode.getNamespaceBinding().getURI());
                    treeWriter.addAttribute(_code, qCode.getDisplayName());
                }

                XStep step = runtime.runningStep();
                if (step != null && step.getNode() != null) {
                    XdmNode node = step.getNode();
View Full Code Here


         public void supplyStaticContext(StaticContext context, int locationId, Expression[] arguments) throws XPathException {
             staticContext = context;
         }

        public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException {
             StructuredQName propertyName = null;

             XProcRuntime runtime = registry.getRuntime(xdef);
             XStep step = runtime.getXProcData().getStep();
             // FIXME: this can't be the best way to do this...
             // FIXME: And what, exactly, is this even supposed to be doing!?
             if (step != null && !(step instanceof XCompoundStep)) {
                 throw XProcException.dynamicError(23);
             }

             try {
                 String lexicalQName = sequences[0].head().getStringValue();
                 propertyName = StructuredQName.fromLexicalQName(
                      lexicalQName,
                      false,
                      false,
                      xPathContext.getConfiguration().getNameChecker(),
                      staticContext.getNamespaceResolver());
             } catch (XPathException e) {
                 if (e.getErrorCodeLocalPart()==null || e.getErrorCodeLocalPart().equals("FOCA0002")
                         || e.getErrorCodeLocalPart().equals("FONS0004")) {
                     e.setErrorCode("XTDE1390");
                 }
                 throw e;
             }

             String uri = propertyName.getURI();
             String local = propertyName.getLocalPart();
             String value = "";

             if (uri.equals(XProcConstants.NS_XPROC)) {
                 if ("episode".equals(local)) {
                     value = runtime.getEpisode();
View Full Code Here

        public void supplyStaticContext(StaticContext context, int locationId, Expression[] arguments) throws XPathException {
            staticContext = context;
        }

        public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException {
            StructuredQName sVarName = null;

            XProcRuntime runtime = registry.getRuntime(xdef);
            XStep step = runtime.getXProcData().getStep();
            // FIXME: this can't be the best way to do this...
            // step == null in use-when
            if (step != null && !(step instanceof XCompoundStep)) {
                throw XProcException.dynamicError(23);
            }

            try {
                String lexicalQName = sequences[0].head().getStringValue();
                sVarName = StructuredQName.fromLexicalQName(
                     lexicalQName,
                     false,
                     false,
                     xPathContext.getConfiguration().getNameChecker(),
                     staticContext.getNamespaceResolver());
            } catch (XPathException e) {
                // FIXME: bad formatting
                throw new XProcException("Invalid variable/option name. " + e.getMessage() + "XTDE1390");
            }

            boolean failIfUnknown = true;

            if (sequences.length > 1) {
                failIfUnknown = ((BooleanValue) sequences[1].head()).effectiveBooleanValue();
            }

            boolean value = false;
            QName varName = new QName(sVarName.getURI(), sVarName.getLocalPart());

            value = step.hasInScopeVariableBinding(varName);

            if (!value) {
                if (failIfUnknown) {
View Full Code Here

        public void supplyStaticContext(StaticContext context, int locationId, Expression[] arguments) throws XPathException {
            staticContext = context;
        }

        public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException {
            StructuredQName stepName = null;

            XProcRuntime runtime = registry.getRuntime(xdef);
            XStep step = runtime.getXProcData().getStep();
            // FIXME: this can't be the best way to do this...
            // step == null in use-when
            if (step != null && !(step instanceof XCompoundStep)) {
                throw XProcException.dynamicError(23);
            }

            try {
                String lexicalQName = sequences[0].head().getStringValue();
                stepName = StructuredQName.fromLexicalQName(
                     lexicalQName,
                     false,
                     false,
                     xPathContext.getConfiguration().getNameChecker(),
                     staticContext.getNamespaceResolver());
            } catch (XPathException e) {
                // FIXME: bad formatting
                throw new XProcException(step.getNode(), "Invalid step name. " + e.getMessage() + "XTDE1390");
            }

            boolean value = false;
            QName stepType = new QName("x", stepName.getURI(), stepName.getLocalPart());

            // FIXME: This doesn't seem terribly efficient...
            while (! (step instanceof XPipeline)) {
                step = step.getParent();
            }
View Full Code Here

    return new SequenceType[] {SequenceType.SINGLE_STRING, SequenceType.SINGLE_STRING};
  }

  @Override
  public StructuredQName getFunctionQName() {
    return new StructuredQName("fusion", "http://code.google.com/p/fusion", "isSubtype");
  }
View Full Code Here

TOP

Related Classes of net.sf.saxon.om.StructuredQName

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.