XInclude requires xml:base= to be declared

When the preference XML > XML / XML Parser > Enable XInclude Processing is checked, I get an error message on validation of the including document if the xml:base= attribute is *not* declared for the root element of the included document. I am guessing that oXygen is tacking on an xml:base= attribute to the root element of the included documents before validation.

Hi Syd, By default an XInclude processor does base URI fix-up, that means adding an xml:base on the included content whose value is the URI of the included file to enable further references from the included content to be correctly resolved. You can pass the including document through a copy stylesheet to see exactly what you get after XInclude processing. You can disable the base URI fix-up from Options->Preferences -- XML / XML Parser by disabling the "Base URI fix-up" option but that is strongly not recommended. Instead, the schema should be changed to allow xml:base on any element. And if you do that change you should add also xml:space and xml:lang and maybe also xml:id. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Syd Bauman wrote:
When the preference XML > XML / XML Parser > Enable XInclude Processing is checked, I get an error message on validation of the including document if the xml:base= attribute is *not* declared for the root element of the included document.
I am guessing that oXygen is tacking on an xml:base= attribute to the root element of the included documents before validation.
------------------------------------------------------------------------
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Thank you, George. I've read your mail (twice) and http://www.w3.org/TR/xinclude/#base as well, and I think I get it.

Hi Syd, It is not that complicated, an example always help: imagine you have a structure like below: main.xhtml report/ report/report1.xhtml report/image1.jpeg and main.xhtml includes through xi:include report/report1.xhtml report1.xhtml has a reference to image1.jpeg <img src="image1.jpeg"/> After processing the includes in main.xhtml it will result a document that will contain also the content of report1.xhtml. That will have as base folder the same folder as main.xhtml. The included content is not changed, that is it will still contain <img src="image1.jpeg"/>. If there will be no xml:base added then that will point to a non existing image. Adding an xml:base pointing to report1.xhtml will allow to correctly resolve the image reference to the report/image1.jpeg location. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Syd Bauman wrote:
Thank you, George. I've read your mail (twice) and http://www.w3.org/TR/xinclude/#base as well, and I think I get it. _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
George Cristian Bina
-
Syd Bauman