Hi Hussein,
On 8 Dec 2014, at 10:17, Hussein Shafie wrote:
First of all, we basically agree about the usefulness of XInclude for
XHTML v1, v1.1 or v5 and with the fact that XInclude support is not
tied to the presence of a DTD.
We are also very conscious of the importance of XHTML5 as a source
format for structured documents. That's why we are currently working
very hard to make our XHTML5 support (schema, CSS, XSL) compliant with
newly released HTML5 spec:
HTML5 A vocabulary and associated APIs for HTML and XHTML
W3C Recommendation 28 October 2014
Oh - I had not realized it had become a Recommendation. :-D Congrats to
all of us who worked with it ... !
For all these reasons, we'll probably restore the support of XInclude
in all the XHTML configurations in the near future. (Sorry to be so
vague but this depends on the success of the implementation of other
features.)
Coolish! I am optimistic!
--> Now, a few facts about XMLmind XML Editor v6+:
* Restoring XInclude in the XHTML v1 and v1.1 configurations is simply
a matter of uncommenting:
<!--
<inclusionScheme name="XInclude">
<class>com.xmlmind.xml.xinclude.XIncludeScheme</class>
</inclusionScheme>
-->
in <XXE_install_dir>/addon/config/xhtml/xhtml1_support_base.incl
Actually, based on what I read in the release notes, the correct place
is the file "xhtml_common.incl" in the same directory. At the very
least, that was the file I edited. However, it seems to me that you have
*deleted* the code - in my case, I had to *add* it.
This will work fine because in XHTML v1 and v1.1 attribute id has a
(DTD) ID type[1].
* The id attribute of XHTML v1, v1.1 or v5 is called "id", not
"xml:id". Using "xml:id" instead of "id" means creating invalid
documents. (Yes, you never suggested to use "xml:id", but this is just
to stress the fact that the XHTML5 spec is not related at all to the
xml:id spec.)
It is not related to the HTML5 spec, that is correct. But, in fact, I
made an attemt of allowing xml:id in XHTML5 (via an extension spec). I
then proposed that authors should use xml:id to duplicate the id
attribute:
<div xml:id="sameValue" id="sameValue">foo</div>
As a consequence, I also suggested that authors should restrict
themselves to values that conform to the XML NCName requirements. (And I
think you could ask the XMLMind XMLeditor users to do the same! THat is,
to limit the id avlues to NCName values.)
In the end, I for various reasons dropped the proposal.
* The id attribute of XHTML v5 definitely does *not* have a (DTD) ID
type[1] or a (XML Schema/RELAX NG) xsd:ID type[2].
Why that? Answer: it's value is not an XML NCName. It may contain any
character, but space characters.
INterestingly, as much as I remember, space characters are permitted in
NCNames ...
For example "123" is a valid XHTML5 id[3].
Yes, this is true. I also tested XMLlint right now, and - indeed - the
XInclude mechanism does not work if the value of the id is id="123". It
then fails with the message that ”XPointer evaluation failed”. I
don’t know why - is XPointer *required* to fail? Or is the problem
simply that XPOinter is a validating processor of some kind?
Nevertheless, it seems to me that id values that starts by a numb is an
edge case. It is possible to ask authors/users to not let the value
begin with a number.
(Btw, for xml:id, it isn’t even permitted to use ":" in the value:
xml:id="not:permitted".)
* This could be a problem to support the XPointer element() Scheme[4],
but not really to support the XPointer xpointer() Scheme[5].
* XMLmind XML Editor supports the XPointer xpointer() Scheme (to a
certain extent) provided that you turn on the "Allow advanced use of
XInclude" option[6] (Menu item "Options|Preferences", "Edit" section
in the dialog box; this option is off by default).
Does this mean that if I 'allow advance use of XInclude' then use of
id="123" already isn’t a problem?
Leif Halvard Silli
References:
[1] http://www.w3.org/TR/xml/#id
[2] http://www.w3.org/TR/xmlschema-2/#ID
[3] http://www.w3.org/TR/html/dom.html#the-id-attribute
[4] http://www.w3.org/TR/xptr-element/
[5] http://www.w3.org/TR/xptr-xpointer/
[6]
http://www.xmlmind.com/xmleditor/_distrib/doc/help/editOptions.html
On 12/07/2014 11:31 PM, Leif Halvard Silli (russisk.no) wrote:
Regarding XInclude, then - for some reason - support in XHTML 1.x
documents is disabled by default. However it is simple to enable, as
described in the release notes for XMLmind XMLeditor version 5.2.[1]
When enabled, it seems like the editor only support simple
inclusion/refernce. That is: the “XPointer element() scheme” is
not
supported. Hence, it is only possible to copy references for which
there
already is a conforming id attribute.
But for XHTML5 documents, the same release notes states that XHTML5
doesn’t really support XInclude, only to add, in a parenthesis,
“(well,
at least, the XPointer element() scheme)”. [1]
Why is that?
Why not support the same simple refence that works in XHTML 1.x
documents. The lack of a XHTML5 dtd should not matter. Because HTML5
spec says that the id attribute is of type ID.[3] Thus XML processors
really SHOULD assign ID type to HTML5’s id attribute. As well, the
specification of ‘xml:id version 1.0’ states that it is really up
to the
application how it performs ID type assignment,[4] and it seems
reasonable to think the same way about “IDness” for id in XHTML5
documents.
For xml:id there is no real link between XML validation and ID type
assignment. By contrast, in XMLmind XMLeditor there *is*, it seems, a
link between validating the document according to DTD and ID type
assignement - which is OK, I guess, for XHTML 1.x documents. But it
seems that id in XHTML5 documents should be more or less handled the
same way that xml:id is treated in e.g. DocBooc - it should not be
tied
to DTD but should rather be linked to the namespace.
* [1] http://www.xmlmind.com/xmleditor/changes.html#v5.2.0
* [2]
http://www.xmlmind.com/xmleditor/_tutorial/modular_doc/index.html
* [3]
https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute
* [4] http://www.w3.org/TR/xml-id/#dt-id-assignment -- leif halvard
silli
On 12/07/2014 04:48 PM, Leif Halvard Silli (russisk.no) wrote:
The tutorial for modular documents says: [1] «XMLmind XML Editor
allows to include in document B some content found in document A.
This feature works by using a special command called Copy As
Reference and then by using one of the normal Paste commands.» Same
page further it says that «Internally, XMLmind XML Editor uses
standard mechanisms, e.g. conref for DITA and XInclude for DocBook».
(Since, confref only works in DITA, consider what I say to not relate
to DITA.)
My problem: The feature does not work in XHTML documents as the
functionality seems hardcoded to the presence of
xmlns="http://docbook.org/ns/docbook" on the root element. E.g. if
one changes the namespace of a <html> element to <html
xmlns="http://docbook.org/ns/docbook">, then the functionality - sort
of - becomes available.
My proposal would be
to make XInclude the (default) embedding function in any document
(except in DITA documents).
to allow the very ‘Copy as Reference’ to command to function in
any file where ID atributes can be found. Or, if not in any file,
then at least in XHTML files - note in that regard that per XHTML5,
then id attributes are considered to be of type ID - this is
specified in the HTML5 spec by reference to the latest version of the
DOM specification. (The sensible thing would be to just consider any
id attribute to be of type ID, regardless of presence of DTD or
schema reference or not.)
to allow content to be be included in any XML file (or at least in
XHTML files) via <xi:include href="foo" /> or <include
xmlns="http://www.w3.org/2001/XInclude" href="foo" /> (except, again,
in DITA documents, where you use the DITA method).
Use cases for supporting XInclude in XHTML that I see and I care for:
Simple previewing of/working with multifile 'books' in XHTML format.
Simple conversion to ePUB 3.
Simple conversion to "flattened" XHTML files (where the included
files have been made part of the 'mother document').
A good editor for working with tools such as Prince XML (a
PDF-formatter with built-in support for XInclude).
Users that would like to embed files can use XHTML instead of first
learning DocBook.
[1] http://www.xmlmind.com/xmleditor/_tutorial/modular_doc/index.html
-- leif halvard silli
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support
<?xml version='1.0' encoding='ISO-8859-1'?>
<configuration
xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"
xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration"
xmlns:html="http://www.w3.org/1999/xhtml">
<help name="xhtml_help" />
<css name="Semantic" location="css/xhtml.css" />
<css name="Emulate Web Browser" location="css/xhtml_user_styles.css"
alternate="true" />
<!-- Leif la til i samsvar med
http://www.xmlmind.com/xmleditor/changes.html#v5.2.0 -->
<inclusionScheme name="XInclude">
<class>com.xmlmind.xml.xinclude.XIncludeScheme</class>
</inclusionScheme>
<!-- Firefox seems to have problems with CDATA sections, that's why
we have removed the following attribute:
cdataSectionElements="html:script html:style"
-->
<cfg:saveOptions favorInteroperability="true" omitXMLDeclaration="auto" />
<!-- Menu ============================================================== -->
<command name="xhtml.preview">
<class>com.xmlmind.xmleditext.xhtml.Preview</class>
</command>
<menu label="_XHTML" insert="after ##last">
<separator />
<item label="Pre_view" icon="xxe-config:common/icons/viewDocument.png"
command="xhtml.preview">
<accelerator code="F5" />
</item>
</menu>
<include location="xslMenu.incl" />
</configuration>
<?xml version='1.0' encoding='ISO-8859-1'?>
<configuration
xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"
xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration"
xmlns:html="http://www.w3.org/1999/xhtml">
<help name="xhtml_help" />
<css name="Semantic" location="css/xhtml.css" />
<css name="Emulate Web Browser" location="css/xhtml_user_styles.css"
alternate="true" />
<!-- Leif la til i samsvar med
http://www.xmlmind.com/xmleditor/changes.html#v5.2.0 -->
<inclusionScheme name="XInclude">
<class>com.xmlmind.xml.xinclude.XIncludeScheme</class>
</inclusionScheme>
<!-- Firefox seems to have problems with CDATA sections, that's why
we have removed the following attribute:
cdataSectionElements="html:script html:style"
-->
<cfg:saveOptions favorInteroperability="true" omitXMLDeclaration="auto" />
<!-- Menu ============================================================== -->
<command name="xhtml.preview">
<class>com.xmlmind.xmleditext.xhtml.Preview</class>
</command>
<menu label="_XHTML" insert="after ##last">
<separator />
<item label="Pre_view" icon="xxe-config:common/icons/viewDocument.png"
command="xhtml.preview">
<accelerator code="F5" />
</item>
</menu>
<include location="xslMenu.incl" />
</configuration>
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support