Package net.sf.saxon.om

Examples of net.sf.saxon.om.AxisIterator


        }
    }

    public void validate() throws XPathException {
        //checkWithinTemplate();
        AxisIterator kids = iterateAxis(Axis.CHILD);
        while (true) {
            NodeInfo child = (NodeInfo)kids.next();
            if (child == null) {
                break;
            }
            if (child instanceof XSLWithParam) {
                // OK;
View Full Code Here


    return currentRow;
  }

  protected void decodeNode( final Object obj, final Map retValue ) {
    if ( obj instanceof TinyNodeImpl ) {
      AxisIterator aIter = ( (TinyNodeImpl) obj ).iterateAxis( Axis.DESCENDANT );
      Object descendent = aIter.next();
      boolean processedChildren = false;
      int columnIndex = 0;
      while ( descendent != null ) {
        if ( ( descendent instanceof TinyNodeImpl ) && ( ( (TinyNodeImpl) descendent )
          .getNodeKind() == Type.ELEMENT ) ) {
          TinyNodeImpl descNode = (TinyNodeImpl) descendent;
          Object value = retValue.get( descNode.getDisplayName() );
          if ( value == null ) {
            value = XQResultSet.EMPTY_STR;
          }
          if ( !( XQResultSet.EMPTY_STR.equals( value ) ) ) {
            value = value.toString() + XQResultSet.DELIM;
          }
          value = value.toString() + descNode.getStringValue();
          if ( ( value != null )
              && !value.equals( "" ) && ( columnTypes != null ) && ( columnIndex >= 0 )
            && ( columnIndex < columnTypes.length ) ) { //$NON-NLS-1$
            String columnType = columnTypes[columnIndex].trim();
            if ( columnType.equals( "java.math.BigDecimal" ) ) { //$NON-NLS-1$
              value = new BigDecimal( value.toString() );
            } else if ( columnType.equals( "java.sql.Timestamp" ) ) { //$NON-NLS-1$
              value = new Timestamp( Long.parseLong( value.toString() ) );
            } else if ( columnType.equals( "java.sql.Date" ) ) { //$NON-NLS-1$
              value = new Date( Long.parseLong( value.toString() ) );
            } else if ( columnType.equals( "java.lang.Integer" ) ) { //$NON-NLS-1$
              value = new Integer( Integer.parseInt( value.toString() ) );
            } else if ( columnType.equals( "java.lang.Double" ) ) { //$NON-NLS-1$
              value = new Double( Double.parseDouble( value.toString() ) );
            } else if ( columnType.equals( "java.lang.Long" ) ) { //$NON-NLS-1$
              value = new Long( Long.parseLong( value.toString() ) );
            }
          }
          retValue.put( descNode.getDisplayName(), value );
          processedChildren = true;
          columnIndex++;
        }
        descendent = aIter.next();
      }
      if ( !processedChildren ) {
        Object key = ( (TinyNodeImpl) obj ).getDisplayName();
        Object value = ( (TinyNodeImpl) obj ).getStringValue();
        retValue.put( key, value );
View Full Code Here

    while ( iter.hasNext() ) {
      rowCount++;
      Object obj = iter.next();
      if ( obj instanceof TinyNodeImpl ) {
        boolean processedChildren = false;
        AxisIterator aIter = ( (TinyNodeImpl) obj ).iterateAxis( Axis.DESCENDANT );
        Object descendent = aIter.next();
        while ( descendent != null ) {
          if ( ( descendent instanceof TinyNodeImpl ) && ( ( (TinyNodeImpl) descendent )
            .getNodeKind() == Type.ELEMENT ) ) {
            TinyNodeImpl descNode = (TinyNodeImpl) descendent;
            processedChildren = true;
            if ( !headers.contains( descNode.getDisplayName() ) ) {
              headers.add( descNode.getDisplayName() );
            }
          }
          descendent = aIter.next();
        }
        if ( !processedChildren ) {
          Object value = ( (TinyNodeImpl) obj ).getDisplayName();
          if ( !headers.contains( value ) ) {
            headers.add( value );
View Full Code Here

TOP

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

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.