-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xml:base in package document and elsewhere #1456
Comments
xml:base
in package document and elsewhere
The note about HTML and SVG dropping support is probably misplaced, as prior to that being added the only mention of xml:base was that reading systems had to support it. But that was only required for completeness of xml processing, not because the attribute is actually allowed in every xml format. It's never been supported in the package document. It might be less confusing to copy the note into both the HTML and SVG definitions, since those are the places where it is relevant. Commenting on xml:base for any format someone might include seems unnecessary. It might also help to move this sentence from the item element definition to a more obvious location:
This is true for all href attributes and anything else that takes a relative IRI (refines, ?). But this begins to tie into #1374. |
@murata2makoto is the expert here. But it is interesting to note that the core XML specification does not include Note, however, that "disallowing" it in HTML is not that simple, because HTML also has the equivalent |
<rant>I opposed to xml:base when it was invented and I still do.</rant> I think that disallowing the xml:base attribute in some XML vocabulary is perfectly fine. It is certainly possible to write a schema (in both RELAX NG and W3C XML Schema) so that this attribute is disallowed or restricted. The latest version of WHATWG HTML does not mention xml:base. In my understanding, this attribute is thus disallowed. We only have to use the base element of HTML. |
Proposal: specify that |
I'm a bit concerned we're creating an issue where none exists. Not that I'm a fan of the attribute, but where else is it allowed that we need to worry about? If nowhere, what does this rule do other than potentially complicate the inclusion of data files and the like? Are those a concern if they're just used by script or travelling harmlessly in the container? And how is this requirement tested outside of content documents? |
@mattgarrish naïve XML users may believe that |
xml:base is not part of the core xml specification (0 items found in the Fifth edition), it is a "facility" defined in a satellite specification. An xml based specification which decide to allow its use must normatively reference it (you can find this in the XML base spec when XLink is given as an example). So xml:base should not be treated as an opt-out as @murata2makoto suggests, but as an opt-in. e.g. I found xml:base defined in SVG 1.1 but not in SVG 2. Nevertheless, because there is no "EPUB best practices" companion for the spec, I'm in favor of a note in the package document spec to make clear that xml:base is not processed by reading systems in such documents. |
@llemeurfr wrote:
This is not what I suggested. You can disallow it by writing a schema that does not mention it. Also, you can allow it by writing a schema that mentions it. |
EPUB 3.0 has normative schemas. They allow xml:base only in XHTML (and MathML in XHTML). |
Banning something from formats we can't specifically identify is a strange precedent. Plus there's always a bigger naive xml user out there, as the old saying goes. ;) Adding this requirement doesn't change anything in terms of the package document, though, as the attribute has never been allowed in it. As @dauwhe found out, put it in the package document and epubcheck will already throw errors at you. I'm also looking at this from an epubcheck perspective and I just don't see this being a realistic requirement to check. We're saying that every xml format has to be validated and errors thrown if xml:base is found, even if xml:base is allowed by the format and regardless of the purpose of the file. (But not for content documents, where nothing will be emitted.) |
Everybody appears to believe that xml:base has been disallowed except for content documents. epubcheck complains if it encounters xml:base. Matt thinks that the spec is already clear and that no further actions are needed. Ivan and Dave think that a note in the spec is useful. If we introduce a note for xml:base, we should do the same thing to xml:lang and xml:space. Moreover, xsi:type, xsi:nil, xsi:noNamespaceSchemaLocation and xsi:schemaLocation also need something similar. We also have XInclude and XLink. Where should we stop? |
I'd actually read the proposal as adding a "MUST NOT" for xml:base anywhere outside of content documents. I'm not advocating for xml:base as much as concerned about the overreach of disallowing it in grammars we don't even control. If there's confusion about how the package document base is calculated, let's address that separately. If we create a new section that explains how the base of the package document is determined for relative URLs, there shouldn't be a need to explain that an attribute that isn't part of the grammar isn't allowed. (Noting not to use the attribute in HTML and SVG is still fine with me.) |
I think the difference is that the spec says that EPUB Reading Systems MUST support the XML Base spec. We don't require support for XLink or XInclude. |
But that's only true, I believe, because XHTML and SVG used to allow xml:base. Since the specifications we now reference no longer include the attribute, we could potentially drop the requirement as part of warning authors against the use of it. It also seems like another case where support is going to be driven by the browser cores more than anything we say in our specification. I can't imagine it's ever been widely used in epub, either. |
How about adding this to the RS spec, just to let implementers know what the story is:
|
The issue was discussed in a meeting on 2021-04-01 List of resolutions:
View the transcript2. Clarify base IRISee github pull request #1468. Dave Cramer: this is a PR about base IRI in package documents See github issue #1374, #1456. Matt Garrish: basically all the PR does is define base IRI for package because it wasn't clear how that was to be calculated Dave Cramer: i'm happy with PR Matt Garrish: the PR seemed to make Ivan happy Dave Cramer: i think we should accept the PR, and then if Laurent wants to raise the other question, maybe he can come back with a more detailed rationale Matt Garrish: there was an issue about whether relative IRIs MUST be resolved, but it was only ever the intention that it be possible if you need to do it
|
I have a new suggestion: What if we just remove the statement saying that an EPUB reading system "MUST be a conformant application as defined by XMLBASE"? That doesn't prevent a reading system from supporting xml:base. But I think the fact that we currently mention it gives xml:base far more importance than it deserves. If I was building a reading system today, I would certainly not support it. |
Do we have any idea whether any EPUB document ever used I would agree with @dauwhe's proposal... |
The issue was discussed in a meeting on 2021-05-21 List of resolutions:
View the transcript2.
|
Closing with #1678 |
EPUBCheck seems unhappy with any use of
xml:base
in the package document. EPUB requires support forxml:base.
I don't even want to think about usingxml:base
incontainer.xml
.Is
xml:base
only for use with EPUB content documents? Can we be clearer in the spec about where it is and isn't allowed?The text was updated successfully, but these errors were encountered: