[XML-SIG] xsl:nclude-and-transform
Mike Olson
Mike.Olson@fourthought.com
Wed, 18 Jul 2001 08:48:00 -0600
Nicolas Chauvat wrote:
>=20
> Hi Lists,
>=20
> Here is what I'd like to do :
>=20
> company.xml (my own DTD)
>=20
> <company>
> <name>Logilab</name>
> <address>10 rue Louis Vicat</address>
> <web>http://www.logilab.com/</web>
> </company>
>=20
> document.xml (DocBook DTD)
>=20
> <article>
> <author>
> <surname>Chauvat</surname>
> <affiliation>
> <!-- insert here the result of company.xml
> transformed with company2docbook.xsl
> should be
>=20
> <orgname>Logilab</orgname>
> <address>
> <street>10 rue Louis Vicat</street>
> </address>
> -->
> </affiliation>
> </author>
>=20
> <sect>
> <!-- the rest of my document -->
> </sect>
> </article>
Why not just use xinclude?
<affiliation?
<xi:include href=3D'company.xml'/>
</affiliation>
Then extend the stylesheet that you would use to process the standard
docbook with templates like:
<xsl:include href=3D'docbook.xsl'/>
<xsl:template match =3D'doc:affiliation/logi:company'>
...
</>
Mike
>=20
> Here are the ideas I had so far :
>=20
> * forget about my own DTD and write company.xml using docbook, the=
n
> include an entity. It already works like this, but I need to
> make it more flexible...
>=20
> * generate the document in two steps : replace the above comment w=
ith
> a specific <include file=3D"company.xml/> tag that gets processe=
d by
> a first XSLT and replaced with the proper docbook elements, then
> feed the result to the docbook generator. The problem is that wh=
en
> you generate a document, you have to know which stylesheet to ap=
ply
> for the first processing step.
>=20
> * generate the document in a single step : modify the above tag to
> specify the stylesheet :
> <include file=3D"company.xml" transform=3D"company2docbook.xsl=
"/>
> and use something like an XSL extension function to replace that
> include tag with the corresponding elements. That would ask for
> docbook XSL customization, but we already do that.
>=20
> * use processing instructions : I don't know much about PI. Could
> I use a PI to do the two-step processing described above by
> including a <?PI use-stylesheet=3D'first-step.xsl'?> in the docu=
ment
> that I feed to the docbook processing step ?
>=20
> * ...
>=20
> As you understood, I'm missing a <xsl:include-after-transform/> tag...
>=20
> I look forward to your ideas and comments.
>=20
> --
> Nicolas Chauvat
>=20
> http://www.logilab.com - "Mais o=F9 est donc Ornicar ?" - LOGILAB, Pari=
s (France)
>=20
> _______________________________________________
> XML-SIG maillist - XML-SIG@python.org
> http://mail.python.org/mailman/listinfo/xml-sig
--=20
Mike Olson Principal Consultant
mike.olson@fourthought.com +1 303 583 9900 x 102
Fourthought, Inc. http://Fourthought.com=20
4735 East Walnut St, http://4Suite.org
Boulder, CO 80301-2537, USA
XML strategy, XML tools, knowledge management