[xsd-users] xlink href use of idref class
Boris Kolpackov
boris at codesynthesis.com
Mon Sep 7 10:11:19 EDT 2015
Hi Laurence,
Laurence Davies <laurence.davies at unsw.edu.au> writes:
> In that case, in the streaming example would this tree of children (stored
> in map_?) be complete? I see in the idref::get() method it performs
> root_()->lookup() which would assume that the correct root container can be
> referenced in root_() and that lookup() can find the matching ID element
> from map_. Considering that in the streaming code the type_ objects are
> often discarded, would keeping a "shell" of the root element solve this
> problem? Or do I need to have the complete tree in memory for it to work
> correctly?
I think you know the answer to this. The ID/IDREF mechanism allows you
to establish a "pointer" from one element anywhere in the *entire*
document to another element, also anywhere in the *entire* document.
The streaming approach allows you not to store the *entire* document
in memory. What do you think, are they compatible, in the general
case?
The only situation where you can use the ID/IDREF mechanism with
streaming is if you know (i.e., this is your vocabulary-specific
knowledge) that the ID points to an element inside the same chunk
that you have parsed.
Boris
More information about the xsd-users
mailing list