Beispiel #1
0
 public int compareTo(XQItem that, ComparisonContext context, int flags) {
   try {
     if ((flags & COMPAR_ORDER) != 0) return Comparison.ERROR;
     QName q1 = getQName(), q2 = that.getQName();
     return (q1.equals(q2)) ? Comparison.EQ : Comparison.FAIL;
   } catch (EvaluationException e) {
     return Comparison.ERROR;
   }
 }
Beispiel #2
0
 public void putElementEnd(QName name) throws DataModelException {
   if (elementStarted) flushElementStart(true);
   if (contentHandler != null)
     try {
       String qname = // TODO avoid double creation by managing a stack
           getNsPrefixes() ? nsContext.prefixedName(name) : "";
       contentHandler.endElement(name.getNamespaceURI(), name.getLocalPart(), qname);
       // remove mappings
       for (int m = 0, cnt = nsContext.getLocalSize(); m < cnt; m++)
         contentHandler.endPrefixMapping(nsContext.getLocalPrefix(m));
     } catch (SAXException e) {
       convertSaxException(e);
     }
   super.putElementEnd(name);
 }
Beispiel #3
0
 public String getString() {
   QName name = getValue();
   String prefix = name.getPrefix();
   if (prefix == null) return name.toString();
   return prefix + ":" + name.getLocalPart();
 }