Sxml (v.1.0.2) API documentation

siena.sxml
Class AttributeRule

java.lang.Object
  |
  +--siena.sxml.AttributeRule

public class AttributeRule
extends java.lang.Object

a rule to assign the value of a specific Siena attribute within an EventMap. The value of the Siena attribute in an EventMap is generated by a set of XML elements within an XML document (nodes is a document tree), selected by an XPath expression. An AttributeRule defines the XPath expression, the type of the Siena attribute, and the method by which a single attribute value is derived from multiple selected nodes.

Example:


      EventMap map = new EventMap();
      AttributeRule rule = new AttributeRule();

      rule.path = "/person/@name";
      rule.type = AttributeValue.BYTEARRAY;
      rule.multivalue = AttributeRule.SEPARATOR;
	rule.separator = ",";

      map.putRule("names", rule);
  


Field Summary
static int FIRST_ONLY
          the value is derived from the first selected node
static int LAST_ONLY
          the value is derived from the last selected node
 int multivalue
          encoding of values from multiple selected nodes.
 java.lang.String path
          selects the nodes that will produce the value of this Siena attribute.
 java.lang.String separator
          separator for encoding multiple values in a single string this value is ignored if multivalue != SEPARATOR.
static int SEPARATOR
          the value is derived from all the selected CDATA nodes by concatenation
 int type
          Siena type identifier.
static int XML
          the value is derived from the XML representation of all the selected ELEMENT nodes
 
Constructor Summary
AttributeRule()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_ONLY

public static final int FIRST_ONLY
the value is derived from the first selected node

LAST_ONLY

public static final int LAST_ONLY
the value is derived from the last selected node

SEPARATOR

public static final int SEPARATOR
the value is derived from all the selected CDATA nodes by concatenation

XML

public static final int XML
the value is derived from the XML representation of all the selected ELEMENT nodes

path

public java.lang.String path
selects the nodes that will produce the value of this Siena attribute. It is interpreted as an XPath. Please, consult the XPath documentation for additional information on syntax and semantics of XPath expressions.

type

public int type
Siena type identifier. valid identifiers are siena.AttributeValue.BYTEARRAY, siena.AttributeValue.LONG, siena.AttributeValue.DOUBLE, etc. Please, consult the Siena Java API documentation for more information.

multivalue

public int multivalue
encoding of values from multiple selected nodes. valid encodings are:

separator

public java.lang.String separator
separator for encoding multiple values in a single string this value is ignored if multivalue != SEPARATOR.
Constructor Detail

AttributeRule

public AttributeRule()

Sxml (v.1.0.2) API documentation

Copyright © 2001 University of Colorado.
This documentation is maintained by Antonio Carzaniga