here is a patch if that makes my change any clearer.  Should i post it to:
http://issues.apache.org/jira/browse/SOLR-78
?



On 12/22/06, ryan mckinley <[EMAIL PROTECTED]> wrote:
>
> 1) i'm assuming the <schema> tag in your schema.xml either doesn't have a
> version="" attribute in it, or has an empty string (or pure white space)
> as the value, is that correct?
>

i have version="1.1" just as in the example schema.


> 2) can you try running resin with the java logging level at "fine" and
> looking for a log line that includes the string "/schema/@version" and let
> us know what it says?
>

I've been messing with the logging, and the area of interist does not
have anything in it.  I *think* i found a real solution though.

In the patched DOMUtil.getText(Node nd, StringBuffer buf), there is a
case statement with:

    case Node.ATTRIBUTE_NODE: /* fall through */
    case Node.ELEMENT_NODE: /* fall through */
    case Node.ENTITY_NODE: /* fall through */
    case Node.ENTITY_REFERENCE_NODE: /* fall through */
    case Node.DOCUMENT_FRAGMENT_NODE:
      NodeList childs = nd.getChildNodes();
      for (int i = 0; i < childs.getLength(); i++) {
        Node child = childs.item(i);
        short childType = child.getNodeType();
        if (childType != Node.COMMENT_NODE &&
            childType != Node.PROCESSING_INSTRUCTION_NODE) {
          getText(child, buf);
        }
      }
      break;

    case Node.TEXT_NODE: /* fall through */
    case Node.CDATA_SECTION_NODE: /* fall through */
    case Node.COMMENT_NODE: /* fall through */
    case Node.PROCESSING_INSTRUCTION_NODE: /* fall through */
      buf.append(nd.getNodeValue());
      break;

The problem occured with a Node.ATTRIBUTE_NODE.  It would get the text
from the body (returning "" in this case).  I moved the
Node.ATTRIBUTE_NODE case so it is treated the same as TEXT_NODE and it
works for resin and the tests pass.

Is this a real solution? or does it just work for the resin XML parser?

ryan

Reply via email to