[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    RE: Possible Bug with Root.fetch ( Splay parent, QName name, QNameSet set, int n )
From:       "Campana Jr., Salvatore J" <sal.campana () hp ! com>
Date:       2004-08-11 21:10:14
Message-ID: 1D9F67DCEDDF86478FA146AC147904570603F0EF () tayexc17 ! americas ! cpqcorp ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Not sure if you'll need it, but here is the MUWS.xsd file which contains
the definition of ResourceState/State
 
-S

________________________________

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();
                 break;
...
 
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
problem....
 
Thanks!!
 
-Sal Campana

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=740440821-11082004>Not sure if you'll need it, but here is the MUWS.xsd 
file which contains the definition of ResourceState/State</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=740440821-11082004></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN 
class=740440821-11082004>-S</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Campana Jr., Salvatore J <BR><B>Sent:</B> 
Wednesday, August 11, 2004 5:03 PM<BR><B>To:</B> 
xmlbeans-dev@xml.apache.org<BR><B>Subject:</B> Possible Bug with Root.fetch ( 
Splay parent, QName name, QNameSet set, int n )<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial color=#000000 size=2>I've attached a simple example of an 
issue I am seeing.&nbsp; This is in the v1 codebase...Have not check v2 
(assuming the same)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Basically I cannot get the value of a 
subelement:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StateInformation resourceState = 
resState.getResourceState();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
//should return a string...</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String state = 
resourceState.getState();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
System.out.println("State: " + state);</DIV>
<DIV>&nbsp;</DIV>
<DIV>What I see in the debugger is:</DIV>
<DIV>&nbsp;</DIV>
<DIV>Root.fetch ( ...)</DIV>
<DIV>...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();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
 break;</DIV>
<DIV>...</DIV>
<DIV>&nbsp;</DIV>
<DIV>So when we get the BEGIN case, the s.getName() is ResourceState and "name" 
is "State".&nbsp; The name I am looking for is State (child of 
ResourceState).&nbsp; Since the names do not match the call to "s = 
s.getFinishSplay()" sets the Splay to the end of the element.&nbsp; Then the 
loop moves on past that element....</DIV>
<DIV>&nbsp;</DIV>
<DIV>Had "s = s.getFinishSplay()"&nbsp;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.....</DIV>
<DIV>&nbsp;</DIV>
<DIV>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....</DIV>
<DIV>&nbsp;</DIV>
<DIV>The example code and generated types can be used to produce the 
problem....</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks!!</DIV>
<DIV>&nbsp;</DIV>
<DIV>-Sal Campana</DIV></BODY></HTML>


["MUWS.xsd" (application/octet-stream)]

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic