Thanks, Ken and Martin for useful explanations ...
I agree to the points mentioned, and am now more clear about this topic.
On 5/3/08, G. Ken Holman <gkholman(_at_)cranesoftwrights(_dot_)com> wrote:
At 2008-05-03 21:49 +0530, Mukul Gandhi wrote:
On 5/3/08, G. Ken Holman <gkholman(_at_)cranesoftwrights(_dot_)com> wrote:
Anyway, unused namespace declarations are innocuous in the result, so
this
is only an aesthetic issue.
I agree.
But the declaration,
xmlns:xs="http://www.w3.org/2001/XMLSchema"
generated in the output XML is not being used anywhere (i.e., there is
no reference to the xs: prefix in the generated XML).
That is *your* problem, not the processor's problem. You added the
namespace node to the result on the document element of the result ... what
if 100 levels deep, 10 megabytes away from the start tag of the document
element, you needed that namespace node to be in scope?
Shouldn't the processor be more intelligent to avoid generating any
namespace declarations which are used nowhere in the output?
By what criteria could that decision possibly be made?
Probably this could be a minor enhancement request for Saxon :)
I agree with Colin: enhancements shouldn't break conformance.
At 2008-05-03 21:57 +0530, Mukul Gandhi wrote:
I would like to learn how this could be non-compliant ...
Because the specification requires all attached namespace nodes to be copied
to the result tree. Since you didn't prune the namespace node for XSD, it
is still attached to the literal result element, so it must be copied.
And the specification cannot imply its removal or be changed to wait for
your test of use: the result tree can be instantaneously serialized, which
would include any attached namespace nodes. As soon as an element's content
is begun, that element's start tag is allowed to be serialized to the output
without keeping it around. Remember the result tree cannot be inspected.
This allows an application not to keep the result tree in memory before
serialization. Your "enhancement" would break so many aspects of
implementation.
I hope this helps.
. . . . . . . . . . . Ken
On 5/3/08, Colin Paul Adams
<colin(_at_)colina(_dot_)demon(_dot_)co(_dot_)uk> wrote:
"Mukul" == Mukul Gandhi <gandhi(_dot_)mukul(_at_)gmail(_dot_)com>
writes:
Mukul> Probably this could be a minor enhancement request for
Mukul> Saxon :)
I can't see Michael accepting it, as it would be non-compliant.
--
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds: publicly-available developer resources and training
G. Ken Holman mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.
http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07
http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:
http://www.CraneSoftwrights.com/legal
--
Regards,
Mukul Gandhi
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--