Пример #1
0
            public JItem mapItem(JItem itemi)
            {
                JNodeInfo item    = (JNodeInfo)itemi;
                bool      isWhite = item.getNodeKind() == net.sf.saxon.type.Type.TEXT && JWhitespace.isWhite(item.getStringValueCS());

                return(isWhite ? null : item);
            }
Пример #2
0
 public override void append(JItem item, JLocation location, int copyNamespaces)
 {
     if (level == 0)
     {
         JXPathException e = new JXPathException("When writing to an XdmDestination, atomic values are only allowed within a document or element node");
     }
     base.append(item, location, copyNamespaces);
 }
Пример #3
0
 public override void append(JItem item, int locationId, int copyNamespaces)
 {
     if (this.locationId == -1)
     {
         this.locationId = locationId;
     }
     base.append(item, locationId, copyNamespaces);
 }
Пример #4
0
        /// <summary>
        /// Evaluate the XPath expression, returning the result as an <c>XdmItem</c> (that is,
        /// a single node or atomic value).
        /// </summary>
        /// <returns>
        /// An <c>XdmItem</c> representing the result of the expression, or null if the expression
        /// returns an empty sequence. If the expression returns a sequence of more than one item,
        /// any items after the first are ignored.
        /// </returns>


        public XdmItem EvaluateSingle()
        {
            net.sf.saxon.om.Item i = exp.evaluateSingle(dynamicContext);
            if (i == null)
            {
                return(null);
            }
            return((XdmItem)XdmValue.Wrap(i));
        }
Пример #5
0
        public override void write(JItem item)
        {
            XmlLocation loc = new XmlLocation();

            if (locationId != -1)
            {
                JLocationProvider provider = getPipelineConfiguration().getLocationProvider();
                loc.BaseUri    = new Uri(provider.getSystemId(locationId));
                loc.LineNumber = provider.getLineNumber(locationId);
            }
            listener.Message((XdmNode)XdmItem.Wrap(item), terminate, loc);
        }
Пример #6
0
        /// <summary>
        /// Evaluate the XPath expression, returning the result as an <c>XdmItem</c> (that is,
        /// a single node or atomic value).
        /// </summary>
        /// <returns>
        /// An <c>XdmItem</c> representing the result of the expression, or null if the expression
        /// returns an empty sequence. If the expression returns a sequence of more than one item,
        /// any items after the first are ignored.
        /// </returns>


        public XdmItem EvaluateSingle()
        {
            JXPathContextMajor context = new JXPathContextMajor(contextItem, config);

            context.setStackFrame(env.getStackFrameMap(), variableValues);
            net.sf.saxon.om.Item i = exp.iterate(context).next();
            if (i == null)
            {
                return(null);
            }
            return((XdmItem)XdmValue.Wrap(i));
        }
Пример #7
0
        /// <summary>
        /// Evaluate the XPath expression, returning the result as an <c>XdmItem</c> (that is,
        /// a single node or atomic value).
        /// </summary>
        /// <returns>
        /// An <c>XdmItem</c> representing the result of the expression, or null if the expression
        /// returns an empty sequence. If the expression returns a sequence of more than one item,
        /// any items after the first are ignored.
        /// </returns>
        /// <exception cref="DynamicError">
        /// Throws <c>Saxon.Api.DynamicError</c> if the evaluation of the XPath expression fails
        /// with a dynamic error.
        /// </exception>


        public XdmItem EvaluateSingle()
        {
            try
            {
                net.sf.saxon.om.Item i = exp.evaluateSingle(dynamicContext);
                if (i == null)
                {
                    return(null);
                }
                return((XdmItem)XdmValue.Wrap(i));
            } catch (net.sf.saxon.trans.XPathException err) {
                throw new DynamicError(err);
            }
        }
Пример #8
0
 public override void write(JItem item)
 {
     XmlLocation loc = new XmlLocation();
     if (locationId != -1)
     {
         JLocationProvider provider = getPipelineConfiguration().getLocationProvider();
         loc.BaseUri = new Uri(provider.getSystemId(locationId));
         loc.LineNumber = provider.getLineNumber(locationId);
     }
     listener.Message((XdmNode)XdmItem.Wrap(item), terminate, loc);
 }
Пример #9
0
 public override void append(JItem item, int locationId, int copyNamespaces)
 {
     if (this.locationId == -1)
     {
         this.locationId = locationId;
     }
     base.append(item, locationId, copyNamespaces);
 }