Closed
Bug 201754
Opened 21 years ago
Closed 11 years ago
XML Inclusions (XInclude)
Categories
(Core :: XML, enhancement)
Core
XML
Tracking
()
VERIFIED
WONTFIX
Future
People
(Reporter: ernestcline, Unassigned)
References
()
Details
(Keywords: helpwanted)
Attachments
(6 files, 3 obsolete files)
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.
Reporter | ||
Comment 1•21 years ago
|
||
Reporter | ||
Comment 2•21 years ago
|
||
Reporter | ||
Updated•21 years ago
|
Attachment #120284 -
Attachment description: File for Basic Inclusion example in spec → disclaimer.xml file for Basic Inclusion example in spec
Reporter | ||
Updated•21 years ago
|
Attachment #120282 -
Attachment description: File for Basic Inclusion example in spec → document.xml file for Basic Inclusion example in spec
Reporter | ||
Comment 3•21 years ago
|
||
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.
Updated•21 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•21 years ago
|
Target Milestone: --- → Future
Comment 4•21 years ago
|
||
Added <?xml-stylesheet?> so we can see if it is included. And altered value of the xi:href attribute.
Comment 5•21 years ago
|
||
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>
Updated•21 years ago
|
Attachment #134605 -
Attachment is obsolete: true
Comment 6•21 years ago
|
||
Sorry for all the spam. Description is the same.
Updated•20 years ago
|
Attachment #120282 -
Attachment is obsolete: true
Updated•20 years ago
|
Updated•20 years ago
|
Whiteboard: Spec is in CR
Comment 8•20 years ago
|
||
(In reply to comment #7) > IMHO it's time to start implement XInclude. I totally agree.
Comment 10•20 years ago
|
||
Comment 11•20 years ago
|
||
Comment 12•20 years ago
|
||
Now XInclude is W3C Recommendation. http://www.w3.org/TR/2004/REC-xinclude-20041220/
Comment 13•20 years ago
|
||
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.
Updated•20 years ago
|
Whiteboard: Spec is in PR
Comment 14•20 years ago
|
||
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.
Comment 15•20 years ago
|
||
You can do XTF extensions using C++ or JavaScript. And actually it may (or should) be possible to implement this as an Extension, a bit like XForms.
Comment 16•20 years ago
|
||
Oh yes, you can implement XTF extensions with C++ - but why not directly if possible?
Comment 17•20 years ago
|
||
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).
Comment 18•20 years ago
|
||
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)...)
Comment 19•20 years ago
|
||
Taking this for now. Not promising anything yet.
Assignee: hjtoi-bugzilla → smaug
Comment 20•20 years ago
|
||
If you need help (maybe implementing some special features), ask me.
Comment 21•20 years ago
|
||
Just an initial patch. Doesn't support XPointer and lacks also loop detection etc.
Comment 22•20 years ago
|
||
Slowly adding new features. This one supports XPointer with external files. Also charset conversion etc.
Attachment #173672 -
Attachment is obsolete: true
Comment 23•20 years ago
|
||
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
Comment 25•19 years ago
|
||
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.
Comment 27•17 years ago
|
||
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?
Comment 28•17 years ago
|
||
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...
Comment 29•16 years ago
|
||
(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.
Updated•16 years ago
|
QA Contact: ashshbhatt → xml
Comment 30•14 years ago
|
||
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...
Comment 31•14 years ago
|
||
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.
Comment 32•14 years ago
|
||
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.
Comment 33•11 years ago
|
||
We don't want this.
Assignee: bugs → nobody
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Updated•11 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•