If you are writing an implementation of the data model that can't
represent every permitted document (specifically, one that can't
represent namespace nodes accurately) then you're going to have to work
out how to approximate the model yourself. I wouldn't advise you to do
this.
You can probably get away with it if your implementation is strictly
read-only (that is, if objects in the model are created only using your
own private interfaces, and are never created by Saxon itself.)
Logically, outputNamespaceNodes() outputs all the namespaces that are
in-scope for a particular element. The "includeAncestors" flag, if set
to false, allows the method to optimize by omitting a namespace that is
also in-scope for the parent of the element.
Michael Kay
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of
> Alain Javier Guarnieri del Gesu
> Sent: 30 December 2003 05:11
> To: saxon-help@...
> Subject: [saxon] Implementing NodeInfo.outputNamespaceNodes()
>
>
> My document object model does not assign namespaces at each
> node. It does not store namespace prefix assignments. It
> requires a namespace prefix resolver, uses a default
> resolver, or generates namespace prefixes as need be.
>
> If I were to dump the document, I'd generate a document that
> had all the namespace declarations in the root document node.
>
> My best guess outputNamespaceNodes is that for the root
> document, all namespace nodes are output including the XML
> namespace. If node is not the root, and includeAncestors is
> false, no namespaces are output, otherwise all namespace
> nodes are output.
>
> Am I close?
>
> --
> Alain Javier Guarnieri del Gesu - javi@...
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign
> up for IBM's Free Linux Tutorials. Learn everything from the
> bash shell to sys admin. Click now!
> http://ads.osdn.com/?ad_id=1278&alloc_id=3371> &op=click
>
> _______________________________________________
>
> saxon-help mailing list
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/s> axon-help
>
|