You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Peter McCracken <pe...@ca.ibm.com> on 2003/06/24 15:52:06 UTC

XInclude

Hi all,

Attached is the preliminary implementation of XInclude that I've developed.
It supports most normal functions: regular includes, text includes,
fallbacks, namespace fix-up, etc, and it should be okay for regular use.

Functionality that is currently missing:
- XPointer support. Currently, only whole files can be included in a
document.  This will require XPath support in Xerces.  Also, there are
problems using XPointers with a streaming API.

- Fix-up of unparsed entities and notations.  If an included document has
attributes which reference unparsed entities or notations which are not in
the root document, they will not be resolved properly.  This is pending
resolution of some issues regarding whether unparsedEntityDecl() and
notationDecl() events can be sent after endDTD() is sent.

- Default pipeline.  XInclude works by creating a new partial pipeline when
a new document is included.  At the moment, this pipeline is always an
XIncludeParserConfiguration.  I plan to add a property, or some other
fuctionality, to allow this to be user specified.  However, an
XIncludeParserConfiguration should be fine for most users.

- Copy features from parent pipeline to child pipeline.  Currently, the
child pipelines only use the default set of features.  I will add
functionality to copy the features of the original pipeline to the created
pipelines.

- Placement of XIncludeHandler in the pipeline.  Currently, the
XIncludeHandler has only been tested if it goes before schema validation in
the pipeline.

- Encoding of included documents when parse="text".  I'm not 100% certain
if text include detects encodings according to the XInclude spec.  See
"advanced testing" below :)

- Advanced testing.  I've tested this on the available online test suite
for XInclude, and it passes all of the tests except those dealing with the
above issues.  However, that is not a complete test suite, and I haven't
done advanced tested other that suite.

- Performance tweaking.  I haven't done any performance testing, but I
suspect XInclude doesn't speed things up at all :)

To use XInclude, specify your ParserConfiguration as an
org.apache.xerces.parsers.XIncludeParserConfiguration.  This will add an
org.apache.xerces.xinclude.XIncludeHandler to the pipeline, which will look
for <include> and <fallback> tags and (presumeably) do The Right Thing when
it finds one.

At the moment, the include process is almost transparent to schema
validation.  However, xml:base attributes are added to included documents
which do not have the same base URI as their parent.  So if you use schema
validation, and your included documents aren't in the same directory as the
including document, make sure your schema allows xml:base attributes on top
level included items.  It's possible that this may change in the future,
but at the moment, don't count on it.

Please let me know if you have any comments, suggestions etc.

Peter McCracken/Toronto/IBM

(See attached file: xinclude.jar)

Re: XInclude

Posted by Michael Glavassevich <mr...@apache.org>.
I noticed some of the implemenation was missing. This was breaking the
build, so I've committed those classes (everything in the
org.apache.xerces.xinclude package) in CVS.

On Tue, 24 Jun 2003, Elena Litani wrote:

> Thank you, Peter. I've committed the code into CVS.
> --
> Elena Litani / IBM Toronto
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>

--------------------
Michael Glavassevich
mrglavas@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: XInclude

Posted by Elena Litani <el...@ca.ibm.com>.
Thank you, Peter. I've committed the code into CVS.
-- 
Elena Litani / IBM Toronto

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org


Re: XInclude

Posted by Joseph Kesselman <ke...@us.ibm.com>.



Just a thought: Another way to prototype XInclude would be to write an XSLT
stylesheet which interprets it and run the document through Xalan.

______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
"The world changed profoundly and unpredictably the day Tim Berners Lee
got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org