Il 25/09/2012 20:29, Rick Flower ha scritto:
> 
> 
> 2) Got my array of use-case elements using the following code:
> 
> (parser document root elementNamed: 'UseCases') elements reject: [:each
> | each isBlankText]
> 
> For whatever reason the array for the returned element has
> empty entries in it -- and looks like the following in my
> case :

They are not empty, they correspond to the whitespace between <UseCases>
and <UseCase>.

If you want to ignore it, you need to create a subclass of DOM_SAXDriver
and override the #ignorableWhitespace: method.  The overridden method
can simply do nothing.  Then to use your driver call this before
starting the parse:

    parser saxDriver: NoWhitespaceSAXDriver new

Paolo

> 
> An instance of Array
>   contents: [
>     [1]:
> 
>     [2]: <UseCase>Use-Case #1</UseCase>
>     [3]:
> 
>     [4]: <UseCase>Use-Case #2</UseCase>
>     [5]:
> 
>   ]
> 
> After running the above reject: code it becomes :
> An instance of Array
>   contents: [
>     [1]: <UseCase>Use-Case #1</UseCase>
>     [2]: <UseCase>Use-Case #2</UseCase>
>   ]


_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to