/** * Get the AVT part as the original string. * * @return the AVT part as the original string. */ public String getSimpleString() { return "{" + m_xpath.getPatternString() + "}"; }
/** * Get the AVT part as the original string. * * @return the AVT part as the original string. */ public String getSimpleString() { return "{" + m_xpath.getPatternString() + "}"; }
/** * Set the "select" attribute. * The required select attribute is an expression; this expression * is evaluated and the resulting object is converted to a * string as if by a call to the string function. * * @param v The value to set for the "select" attribute. */ public void setSelect(XPath v) { if (null != v) { String s = v.getPatternString(); m_isDot = (null != s) && s.equals("."); } m_selectExpression = v; }
/** * Set the "select" attribute. * The required select attribute is an expression; this expression * is evaluated and the resulting object is converted to a * string as if by a call to the string function. * * @param v The value to set for the "select" attribute. */ public void setSelect(XPath v) { if (null != v) { String s = v.getPatternString(); m_isDot = (null != s) && s.equals("."); } m_selectExpression = v; }
/** * Set the "select" attribute. * xsl:sort has a select attribute whose value is an expression. * For each node to be processed, the expression is evaluated * with that node as the current node and with the complete * list of nodes being processed in unsorted order as the current * node list. The resulting object is converted to a string as if * by a call to the string function; this string is used as the * sort key for that node. The default value of the select attribute * is ., which will cause the string-value of the current node to * be used as the sort key. * * @param v Value to set for the "select" attribute */ public void setSelect(XPath v) { if (v.getPatternString().indexOf("{") < 0) m_selectExpression = v; else error(XSLTErrorResources.ER_NO_CURLYBRACE, null); }
/** * Set the "select" attribute. * xsl:sort has a select attribute whose value is an expression. * For each node to be processed, the expression is evaluated * with that node as the current node and with the complete * list of nodes being processed in unsorted order as the current * node list. The resulting object is converted to a string as if * by a call to the string function; this string is used as the * sort key for that node. The default value of the select attribute * is ., which will cause the string-value of the current node to * be used as the sort key. * * @param v Value to set for the "select" attribute */ public void setSelect(XPath v) { if (v.getPatternString().indexOf("{") < 0) m_selectExpression = v; else error(XSLTErrorResources.ER_NO_CURLYBRACE, null); }
/** * The number of nodes in the result snapshot. Valid values for * snapshotItem indices are <code>0</code> to * <code>snapshotLength-1</code> inclusive. * @exception XPathException * TYPE_ERR: raised if <code>resultType</code> is not * <code>UNORDERED_NODE_SNAPSHOT_TYPE</code> or * <code>ORDERED_NODE_SNAPSHOT_TYPE</code>. * * @see org.w3c.dom.xpath.XPathResult#getSnapshotLength() */ public int getSnapshotLength() throws XPathException { if ((m_resultType != UNORDERED_NODE_SNAPSHOT_TYPE) && (m_resultType != ORDERED_NODE_SNAPSHOT_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_GET_SNAPSHOT_LENGTH, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The method getSnapshotLength cannot be called on the XPathResult of XPath expression {0} because its XPathResultType is {1}. } return m_list.getLength(); }
/** * @see org.w3c.dom.xpath.XPathResult#getBooleanValue() */ public boolean getBooleanValue() throws XPathException { if (getResultType() != BOOLEAN_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_BOOLEAN, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a boolean." } else { try { return m_resultObj.bool(); } catch (TransformerException e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
/** * The value of this number result. * @exception XPathException * TYPE_ERR: raised if <code>resultType</code> is not * <code>NUMBER_TYPE</code>. * @see org.w3c.dom.xpath.XPathResult#getNumberValue() */ public double getNumberValue() throws XPathException { if (getResultType() != NUMBER_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_XPATHRESULTTYPE_TO_NUMBER, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a number" } else { try { return m_resultObj.num(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_SNAPSHOT_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg);
/** * The value of this string result. * @exception XPathException * TYPE_ERR: raised if <code>resultType</code> is not * <code>STRING_TYPE</code>. * * @see org.w3c.dom.xpath.XPathResult#getStringValue() */ public String getStringValue() throws XPathException { if (getResultType() != STRING_TYPE) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_STRING, new Object[] {m_xpath.getPatternString(), m_resultObj.getTypeString()}); throw new XPathException(XPathException.TYPE_ERR,fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be converted to a string." } else { try { return m_resultObj.str(); } catch (Exception e) { // Type check above should prevent this exception from occurring. throw new XPathException(XPathException.TYPE_ERR,e.getMessage()); } } }
m_pw.print("match='" + et.getMatch().getPatternString() + "' ");
String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_CANT_CONVERT_TO_SINGLENODE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR,fmsg);
+ ev.m_attributeName + "='" + ev.m_xpath.getPatternString() + "': "); } else {
String pstring = template.getMatch().getPatternString(); TemplateSubPatternAssociation association = new TemplateSubPatternAssociation(template, pattern, pstring);
String pstring = template.getMatch().getPatternString(); TemplateSubPatternAssociation association = new TemplateSubPatternAssociation(template, pattern, pstring);
Object[] msgArgs = new Object[]{ new Integer(loopCount), idIs, ((null != template.getName()) ? template.getName().toString() : template.getMatch().getPatternString()) }; String msg = XSLMessages.createMessage("recursionTooDeep", msgArgs);
} catch (TransformerException te) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."}, } catch (TransformerException te) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_INCOMPATIBLE_TYPES, new Object[] {m_xpath.getPatternString(), getTypeString(getTypeFromXObject(m_resultObj)),getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg); // "The XPathResult of XPath expression {0} has an XPathResultType of {1} which cannot be coerced into the specified XPathResultType of {2}."},
if ((m_resultType != UNORDERED_NODE_ITERATOR_TYPE) && (m_resultType != ORDERED_NODE_ITERATOR_TYPE)) { String fmsg = XPATHMessages.createXPATHMessage(XPATHErrorResources.ER_NON_ITERATOR_TYPE, new Object[] {m_xpath.getPatternString(), getTypeString(m_resultType)}); throw new XPathException(XPathException.TYPE_ERR, fmsg);
/** * Get the AVT part as the original string. * * @return the AVT part as the original string. */ public String getSimpleString() { return "{" + m_xpath.getPatternString() + "}"; }