212 bytes, text/xml
274 bytes, text/xml
276 bytes, application/xhtml+xml
2 bytes, text/plain
234 bytes, application/xhtml+xml
51.24 KB, patch
|Details | Diff | Splinter Review|
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3) Gecko/20030312 Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3) Gecko/20030312 Mozilla currently has no support for XML Inclusions (XInclude) as far as I can tell. SInce the necessary background parts (Including the XPointer stuff which just recently got fixed) are in there already, it's not as if this looks at first glance as if this would be too difficult to implement. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Attachment #120284 - Attachment description: File for Basic Inclusion example in spec → disclaimer.xml file for Basic Inclusion example in spec
Attachment #120282 - Attachment description: File for Basic Inclusion example in spec → document.xml file for Basic Inclusion example in spec
Added the dependencies, even tho they are for features already added just in case they should somehow become unfixed or implementing this enhancement requires changes to them.
16 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
16 years ago
Target Milestone: --- → Future
Added <?xml-stylesheet?> so we can see if it is included. And altered value of the xi:href attribute.
Comment on attachment 134605 [details] file that points directly to the disclaimer <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet?> <document xmlns:xi="http://www.w3.org/2001/XInclude"> <p>120 Mz is adequate for an average home user.</p> <xi:include href="http://bugzilla.mozilla.org/attachment.cgi?id=120284&action=view"/> </document>
Sorry for all the spam. Description is the same.
IMHO it's time to start implement XInclude.
(In reply to comment #7) > IMHO it's time to start implement XInclude. I totally agree.
Now XInclude is W3C Recommendation. http://www.w3.org/TR/2004/REC-xinclude-20041220/
This could perhaps be implemented using XTF. Hmm, when should the 'load' event be dispatched, after processing all xi:include elements? In that case XTF itself may not be enough - but still useful.
Personally, I'd prefer to see that implemented in pure C++ (as this is, of coure, faster and not that more difficult). Look at NS_NewElement(...) in mozilla/content/base/src/nsNameSpaceManager.cpp#400 (http://lxr.mozilla.org/seamonkey/source/content/base/src/nsNameSpaceManager.cpp #400). When implementing a new namespace, you just need to insert a new if(...) there.
Oh yes, you can implement XTF extensions with C++ - but why not directly if possible?
I haven't yet read the specification exactly, but if every xi:include-element could only include one root node with children, not some consecutive nodes, the implementation shouldn't be that hard (insert a NS_NewXInclude() function into the namespace manager, which doesn't return the include-element itself but the tree to be included).
OK, I don't think that would work... Once because inclusion of multiple nodes with a single xi:include is possible, and also because a former processed xi:include-element must be adressable by later ones. So we need some sort of loop over the tree once it has finished loading. Is it possible to register an event listener or something like that therefore? (onload doesn't seem to be good for that, because once onload is fired, the tree should be finished (including XInclude processing)...)
Taking this for now. Not promising anything yet.
Assignee: hjtoi-bugzilla → smaug
If you need help (maybe implementing some special features), ask me.
Just an initial patch. Doesn't support XPointer and lacks also loop detection etc.
Slowly adding new features. This one supports XPointer with external files. Also charset conversion etc.
Attachment #173672 - Attachment is obsolete: true
A lot of http://www.w3.org/XML/Test/XInclude/#releases XI examples.
Did you read the last paragraph of http://www.w3.org/TR/2004/REC-xinclude-20041220/#creating-result, right before the example. That seems really hard to implement :(. You'd basically have to clone the document before any includes are processed
While trying to move to a on-the-spot conversion (XML + XSLT) --> HTML for Firefix, I hit this limitation... Till now I was using XInclude for manual processing, but I cannot do it inside the browser. Are there any alternatives to XInclude? Currently I might use SSI on the server side to include the necesarry file (it is a kind of glossary) in the document, but that is not a good solution anyway. No progress since february, so I guess asking about a target to land in mainline is naive...
In the context of XSLT you might be able to replace XInclude with either the <xsl:import> element or the document() XPath function. However, that doesn't change the fact that this bug is IMHO something we want to fix.
I'm also looking for a way to include a XML file into another XML file. <xsl:import> can only include a stylesheet into another stylesheet, not it's not what I'm looking for. Are there any other alternatives?
As Jonas said, with XSLT you can use something like <apply-templates select="document('abc.xml');" /> But of course this is not XInclude and does not affect that this bug should be fixed...
(In reply to comment #24) > Did you read the last paragraph of > http://www.w3.org/TR/2004/REC-xinclude-20041220/#creating-result, right before > the example. > > That seems really hard to implement :(. You'd basically have to clone the > document before any includes are processed > IMO the xpointer feature is not that important. A partial XInclude implementation where this feature is omitted would satisfy me, at least. Otherwise, maybe the xi:include elements could be not replaced but get the included content as their contents. This would result in invalid xml however. Cloning the source document might be the only option to do this right.
This seems like something that would be / could potentially be, widely used if implemented. Being able to include arbitrary XML documents in one another seems an awfully fundamental ability to have been left out for so long...
Note that often, you may be tempted to identify the target for inclusion by its ID -- see bug # 275196 , 6 years old... Without xml:id implemented, you're left with a subset of the element() scheme or including entire files (with just @href, no @xpointer). Still, you're right, even @href-based inclusion alone would be a *leap* forward.
Funny post from the now defunct CDF/WICD mailing list: http://lists.w3.org/Archives/Public/public-cdf/2008Dec/0000.html "I think that are too many different ways to build compound documents, either by reference or by inclusion. At the moment we have: 1) XHTML2 embedding attributes 2) XHTML2 / 5 object 3) XHTML5 embed 4) XInclude 5) XLink type="embed" / type="resource" 6) CSS content: uri(); property 7) DTD external entities 8) XBL or XSLT (which could transform markup across languages) 9) Direct inclusion (ie plain writing or server-side processing) Plus we have media specific, like svg image, xhtml 2/5 img, smil media object, css background-image / border-image; I was wondering if any work was started to provide a unform way, instead of relying on single language capabilities (which seems the current orientation of CDRF and CDIF) Giovanni" And yet none of these are quite ideal (well I suppose the generalized object tags from XHTML 2 would have been pretty cool, but even that wouldn't have solved the problem on the lower level of XML.) I'm unfortunately still resorting to SSI probably more than I should.
We don't want this.
Assignee: bugs → nobody
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.