3128 public String getNodeValue(int nodeHandle)
3129 {
3130
3131 int identity = makeNodeIdentity(nodeHandle);
3132 int type = _type2(identity);
3133
3134 if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE)
3135 {
3136 int dataIndex = _dataOrQName(identity);
3137 if (dataIndex > 0)
3138 {
3139 return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS,
3140 dataIndex & TEXT_LENGTH_MAX);
3141 }
3142 else
3143 {
3144 return m_chars.getString(m_data.elementAt(-dataIndex),
3145 m_data.elementAt(-dataIndex+1));
3146 }
3147 }
3148 else if (DTM.ELEMENT_NODE == type)
3149 {
3150 return getStringValueX(nodeHandle);
3151 }
3152 else if (DTM.DOCUMENT_FRAGMENT_NODE == type
3153 || DTM.DOCUMENT_NODE == type)
3154 {
3155 return null;
3156 }
3157 else
3158 {
3159 int dataIndex = m_dataOrQName.elementAt(identity);
3160
3161 if (dataIndex < 0)
3162 {
3163 dataIndex = -dataIndex;
3164 dataIndex = m_data.elementAt(dataIndex + 1);
3165 }
3166
3167 return (String)m_values.elementAt(dataIndex);
3168 }
3169 }
3170
3171 /**
3172 * Copy the String value of a Text node to a SerializationHandler
|
3128 public String getNodeValue(int nodeHandle)
3129 {
3130
3131 int identity = makeNodeIdentity(nodeHandle);
3132 int type = _type2(identity);
3133
3134 if (type == DTM.TEXT_NODE || type == DTM.CDATA_SECTION_NODE)
3135 {
3136 int dataIndex = _dataOrQName(identity);
3137 if (dataIndex > 0)
3138 {
3139 return m_chars.getString(dataIndex >>> TEXT_LENGTH_BITS,
3140 dataIndex & TEXT_LENGTH_MAX);
3141 }
3142 else
3143 {
3144 return m_chars.getString(m_data.elementAt(-dataIndex),
3145 m_data.elementAt(-dataIndex+1));
3146 }
3147 }
3148 else if (DTM.ELEMENT_NODE == type || DTM.DOCUMENT_FRAGMENT_NODE == type
3149 || DTM.DOCUMENT_NODE == type)
3150 {
3151 return null;
3152 }
3153 else
3154 {
3155 int dataIndex = m_dataOrQName.elementAt(identity);
3156
3157 if (dataIndex < 0)
3158 {
3159 dataIndex = -dataIndex;
3160 dataIndex = m_data.elementAt(dataIndex + 1);
3161 }
3162
3163 return (String)m_values.elementAt(dataIndex);
3164 }
3165 }
3166
3167 /**
3168 * Copy the String value of a Text node to a SerializationHandler
|