[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: @xml-base in subtrees included (a) via entityexpansion, an
Perhaps resort to a configuration parameter? Such a setting (say "external-fragment-base-uri") with two possible values (say, fragment-root|fragment-parent) representing the "external entity way" versus the "xs:include" way? The default value of such a setting should probably be fragment-root, as the expansion of external entities is part of the XML standard, whereas the expansion of xs:include is not. Kind regards, Hans-Jürgen Michael Kay <mike@saxonica.com> schrieb am 18:29 Mittwoch, 15.November 2017: Patrik Stellman raised a problem on the saxon-help list for which I would appreciate advice. When an external entity is expanded, and the entity in question contains an element with an xml-base attribute, the value of the @xml:base attribute is supposed to be resolved against the base URI of the external entity itself (not against the base URI of the element into which the entity's expansion is grafted). But when xi:include is processed, the xi:include processor injects an @xml:base attribute which is intended to be resolved against the base URI of the "include parent" (that is, the parent of the xi:include element). Saxon, as receiver of events notified by the XML parser, is interpreting the two situations in the same way. If the systemId of an element is different from the systemId of its parent, it assumes that the child element was produced by entity expansion, and that the @xml-base attribute should therefore be resolved relative to the systemId of the child element. But this ignores the possibility that the child element was actually produced by XInclude expansion: this will also cause the child element and parent element to have different SystemIds (as notified by a SAX parser), but this time the @xml-base attribute should be resolved against the base URI of the (new) parent element. Can anyone suggest a way in which Saxon, as receiver of SAX events, can distinguish the two cases and interpret them both correctly? Michael Kay Saxonica _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: xml-dev-unsubscribe@l... subscribe: xml-dev-subscribe@l... List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|