xml-xmlbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Campana Jr., Salvatore J" <sal.camp...@hp.com>
Subject RE: Possible Bug with Root.fetch ( Splay parent, QName name, QNameSet set, int n )
Date Wed, 11 Aug 2004 21:10:14 GMT
Not sure if you'll need it, but here is the MUWS.xsd file which contains
the definition of ResourceState/State


From: Campana Jr., Salvatore J 
Sent: Wednesday, August 11, 2004 5:03 PM
To: xmlbeans-dev@xml.apache.org
Subject: Possible Bug with Root.fetch ( Splay parent, QName name,
QNameSet set, int n )

I've attached a simple example of an issue I am seeing.  This is in the
v1 codebase...Have not check v2 (assuming the same)
Basically I cannot get the value of a subelement:
        StateInformation resourceState = resState.getResourceState();
        //should return a string...
        String state = resourceState.getState();
        System.out.println("State: " + state);
What I see in the debugger is:
Root.fetch ( ...)
 (line 3314)case BEGIN :
               if (nameHit( name, set, s.getName() ))
                       _child = s;
                       _n = 0;
                       break loop;
                //I don't think this should be here.....
                s = s.getFinishSplay();
So when we get the BEGIN case, the s.getName() is ResourceState and
"name" is "State".  The name I am looking for is State (child of
ResourceState).  Since the names do not match the call to "s =
s.getFinishSplay()" sets the Splay to the end of the element.  Then the
loop moves on past that element....
Had "s = s.getFinishSplay()" not been called, then the next time through
the loop (Splay s = parent.nextSplay()) would get the Splay named
"State" and the names would match and everything would be happy.....
I'm not sure of the implications of this change or exactly what Splay
does, so I pose it to the dev team for review....
The example code and generated types can be used to produce the
-Sal Campana

View raw message