A
Arved Sandstrom
[ SNIP ]
No perhaps about it! Thanks for reminding me of that method. I need to
make time to review core APIs every so often.
Apparently neither does W3C.
AHS
new Enumeration() {
int index = 0;
InputStream streams[] = new InputStream[] {bsBegin, in, bsEnd};
@Override
public boolean hasMoreElements() {
return index < streams.length;
}
@Override
public Object nextElement() {
return streams[index++];
}
});
Perhaps easier to do Collections.enumeration(Arrays.asList(bsBegin, in,
bsEnd)).
No perhaps about it! Thanks for reminding me of that method. I need to
make time to review core APIs every so often.
In the formal sense I'm not sure I see the point of them either.Yes, good trick. As a general pattern (topping and tailing some stream
of items with start-container and end-container markers), it's useful in
all sorts of places. Admittedly most when dealing with XML.
Is there any support for getting parsers to parse multiple fragments
from a single stream? If not, we're back to needing to frame the stream
in some way, and then we might as well parse it as a sequence of
documents. I'm pretty hazy on what the point of document fragments is,
really.
tom
Apparently neither does W3C.
AHS