From: Artur H. <ko...@pl...> - 2003-08-30 13:37:43
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Well, I started to work on documentation, read what we have done and again search information about XML. Some time ago I had concern how to have one common document info included in each file such as: author, copyright and some other info but don't have this info repeated in master document at the beginning of each section in target format. The more I would like to be able to publish also each part as separate document and then, of course, I want this document info to be displayed. Now, I think I found a solution with use of xinclude and xpath. Let's assume we have or parts of our documentation in following form: (samplefile.xml) <section> <sectioninfo> <authorgroup> </authorgroup> <date> </date> <copyrigth> </copyright> </sectioninfo> <title></title> <abstract></abstract> <para></para> <para></para> <para></para> <'all other elements'/> <sectio></section> <sectio></section> <sectio></section> </section> Now we want to include in master document everything apart from <sectioninfo/> element with it's content. We can include content of above document apart from <sectioninfo/> with following command: <xi:include href="samplefile.xml#xpointer(/section/*[name()!='sectioninfo']/descendant-or-self::*)" xmlns:xi="http://www.w3.org/2001/XInclude" /> But above command includes only content of section - root element. If you want to have it as separate section in master document you have to embrace above command with <section> element. Artur - -- Artur Hefczyc "Don't change people, just live with them." Open Source Developer: http://www.geotools.org/ http://generguide.sourceforge.net/ http://wttools.sourceforge.net/ http://maven-plugins.sourceforge.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/UKh+0/6x1bjSKPkRAp+mAJ9jOGa3qzlt9t8zGXPLuWx3ZEjFWwCgpYMH 0KM4I6ZRyoykLZ5Q8b0tISs= =NyXw -----END PGP SIGNATURE----- |