You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2006/12/24 01:47:26 UTC

[jira] Assigned: (SOLR-92) XML parsing error with resin-3.0.21

     [ http://issues.apache.org/jira/browse/SOLR-92?page=all ]

Hoss Man reassigned SOLR-92:
----------------------------

    Assignee: Hoss Man

should have put this in the bug instead of email...

http://www.nabble.com/Schema-Parsing-Failed%2C-fix--tf2868892.html#a8038207

----

: : Node.ATTRIBUTE_NODE case so it is treated the same as TEXT_NODE and it
: : works for resin and the tests pass.
:
: Hmmm... yeah, this seems to be a mistake in the DOM-Level-3-Core
: description of what getText is suppose to do ... it says that for
: ATTRIBUTE_NODE you should concat all of the children -- but how would an
: ATTRIBUTE ever have children?

Did some more reading ... according to DOM-Level-3-Core, an Attr's allowed
children are "Text" and "EntityReference".

Xerces2-j NodeImpl..getTextContent duplicates the table from the
Level-3-Core docs (which is also in the java 1.5 javadocs for
org.w3c.dom.Node.getTextContent()) which the notable exception that they
move ATTRIBUTE_NODE down into the second row (indicating nodeValue should
be used instead of concating the children) ... the impl backs this up
(AttrImpl inherits getTextContent from NodeImpl, which by default returns
this.getNodeValue())

http://xerces.apache.org/xerces2-j/javadocs/xerces2/org/apache/xerces/dom/NodeImpl.html#getTextContent()
http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Node.html#getTextContent()
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/AttrImpl.java?view=markup
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/NodeImpl.java?view=markup

Fortunately, the DOM Spec says that accessing the Attr.nodeValue is
defined to be Attr.value, which is documented as...

        On retrieval, the value of the attribute is returned as a string.
        Character and general entity references are replaced with their values.

...so even if someone out there is acctually obeying the spec about
giving Attr's child nodes, we should still be safe using getNodeValue in
the Node.ATTRIBUTE_NODE case since the spec says that needs to work too.

------

...i'll commit this change along with some more comments explaining it

> XML parsing error with resin-3.0.21
> -----------------------------------
>
>                 Key: SOLR-92
>                 URL: http://issues.apache.org/jira/browse/SOLR-92
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: running resin-3.0.21
>            Reporter: Ryan McKinley
>         Assigned To: Hoss Man
>            Priority: Minor
>         Attachments: resinXmlParser.patch
>
>
> When the resin XML parser starts, it gets the following error trying to parse the config file:
> [00:25:35.025] Caused by: java.lang.NumberFormatException: empty String
> [00:25:35.025]  at
> sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:994)
> [00:25:35.025]  at java.lang.Float.parseFloat(Float.java:394)
> [00:25:35.025]  at org.apache.solr.core.Config.getFloat(Config.java:174)
> [00:25:35.025]  at
> org.apache.solr.schema.IndexSchema.readConfig(IndexSchema.java:273)
> see: http://www.mail-archive.com/solr-dev@lucene.apache.org/msg01852.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira