Thanks for the suggestion, but we won't be making that change to STAX. The 
STAX has been available since 2001 and there are many existing STAX jobs 
that use the current if/else/elseif syntax.  The current syntax works well 
for nested ifs, etc.  Also, it's clearly documented in the STAX User's 
Guide with many examples.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   [EMAIL PROTECTED]
(512) 838-8347 or Tieline 678-8347




"Devvan Stokes" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
09/12/2008 12:34 PM

To
<staf-users@lists.sourceforge.net>
cc

Subject
[staf-users] stax xml structuring suggestion






I got a few parse errors trying the following:

<if expr= " some conditional ">
  <log> </log>
</if>
<else>
  <log> </log>
</else>

Of course, the proper structuring for this, in STAX, is to nest the 'else' 
inside of the 'if'. This is pretty counter-intuitive to what must be 
almost all programmers. Though STAX isn't a programming language, per se, 
when an 'if' condition fails, the natural place for a programmer's eyes to 
go is past the closing of the 'if' scope (in this case, to the closing of 
the 'if' element).

I would suggest a structure like this:

<conditional>
  <if expr=" ">   </if>
  <else>   </else>
</conditional>

That's more to type, but I imagine it's easy for an XML parser to make 
sense of the relationship between the if/else elements.  I'd prefer the 
first structure that is listed in this email, w/o the extra 'conditional' 
element. If and else are mutually exclusive in execution, so their 
elements should, ideally, be exclusive, without one being subordinate to 
the other.

Thoughts?
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's 
challenge
Build the coolest Linux based applications with Moblin SDK & win great 
prizes
Grand prize is a trip for two to an Open Source event anywhere in the 
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to