Using getAttribute to get the number of servings  Constructing a new instance of Recipe from scratch (a new Recipe XML document)

Chapter 2: Understanding the DataBean Framework

Getting the ingredient elements from the IngredientList

To get the first ingredient:

     Ingredient ing = ingList.getIngredient(0);

     if( !ing.hasValidElement())

  {

       // We are at the end of the list of Ingredients         ing=null;

       break;

   }

To target all ingredients:

java.util.List ings=ingList.getIngredients();





Copyright © 2005. Sybase Inc. All rights reserved. Constructing a new instance of Recipe from scratch (a new Recipe XML document)

View this book as PDF