-
Notifications
You must be signed in to change notification settings - Fork 100
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
XInclude by xml:id
and automatic <xi:fallback/>
#187
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me.
Note that there's the occasional xinclide typo though
Typo fixed, also fixed an error condition. Two follow ups: Suggested convention for XInclude I was experimenting with some reserved syntax for xml:id of includes, but as xml:id are So in the examples above, the xml:ids created for XInclusion would be like Suggested convention for XInclude xi:fallback: Speaking of failures, the other follow up is that <xi:include xpointer="function.fgetcsv..parameters..separator">
<xi:fallback><!--doc-en-fatal--></xi:fallback>
</xi:include> So that in the XInclude fixups, it would be possible to detect and report XInclude failures, and also make it fatal again on doc-en. Instead of |
Scratch the thing about
For example, an XInclude like this: <xi:include xpointer="nothing"/> Is reported as:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good. This functionality is badly needed to avoid all that duplicated content we still have in doc-en
.
I tested this specially. Mass deleted I think this PR is ready to merge, but as I have (many) other PRs, I will keep merging at a slow pace, to avoid mixing the issues they address. Editors are welcome to merge this, to accelerate the new simpler XInclude by xml:id, automatic xi:fallback/ usage. |
xml:id
and automatic <xi:fallback/>
Delaying this, waiting for #194 . Also, let me use this to write about what I tried so far:
There is now so much code that was written around libxml missing XInclude 1.1, that now may be the time to write code about XInclude 1.1 itself. That is, to implement the entire XInclude in pure PHP. This may sound ludicrous (as it is), and yet may be the only viable and stable solution, instead waiting for libxml Xinclude 1.1 support that is not even planned. The next push will change implementation to the third item above (use annotations at target's parent). It also adds code removing duplicated IDs after XInclude, that may be the result of mixed XPath/xml:id xpointer usage, and now, recursive XInclude usage. it still remains an imperfect solution for the problem, but will enable start using xml;Id pointers, instead of xpaths. This all makes me concludes that ID schema for XInclude (that is, |
This got conflicted after PR 194, as expected. PR 194 was a quick fix, PR 196 completes it, and further conflicts here. Instead of cherry picking this (now) big change set, I will do a start over after PR 196. A prototype for XInclude 1.1 by xml:id in pure PHP code was successful and way simpler/smaller than this PR. I will try this alternative in the following week, after merging 196. Thanks so much for your reviews, sorry for the noise. Backing up to sequential, semanal changes. |
This PR includes a fixup step on
configure.php
XInclude processing, to the effect to simulating XML Inclusions Version 1.1.With this PR, an
doc-en
manual with this changes builds ok:The
xi
prefix or..
separators are not special. They are only a suggestion for a convention for these structurally incorrectxml:id
s, but the code works perfectly ok with any xml:id.This will also enable putting some of
language-snippets.ent
entities that are tightly related to an extension, and XIncluding these "hosted" entities directly from their extension related xml:id.Fun fact: The PHP manual has ~25.000 IDs at XInclude processing step. Inspecting they two times in a row takes almost no time.