Hi Brett,
On Mittwoch, 18. Juli 2007, Brett Leber wrote:
>
> I'd like to create a new admonition element,
"DataShop Tip",
> [...]
>
> default namespace = "http://docbook.or
g/ns/docbook"
> namespace db = "http://docbook.or
g/ns/docbook"
> namespace r = "http://nw
alsh.com/xmlns/schema-remap/"
>
> div {
> db.datashoptip.role.attribute = attribute role
> db.datashoptip.attlist =
> db.datashoptip.role.attribute?
> & db.common.attributes
> & db.common.linking.attributes
> db.datashoptip =
> [ r:remap [ db:tip [ ] ] ]
> element datashoptip { db.datashoptip.attlist,
> db.admonition.contentmodel }
> }
>
> # combined pattern
> ds.admonition.blocks = db.datashoptip
>
> include "file:///e:/docbook.rnc"
> {
> # datashop admonitions are permitted everywhere
that regular
> admonitions are
> db.admonition.blocks |= ds.admonition.blocks
> }
> How does this look for the .rnc file?
As far as I can tell, it works for me.
> I'll also need to create an XSLT
> template for this new element, so any advice for that
step would be
> appreciated as well.
You have to write a customization layer[1]. It's a very
similar method
that you applied for your DocBook schema.
Use the stylesheets from [2] with the name
"docbook-xsl-ns-snapshot.zip".
Roughly speaking, it's "optimized" for DocBook 5.
;)
Your customization layer looks like this:
------------------------------------------------------------
-------
<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
xmlns:d="http://docbook.or
g/ns/docbook"
xmlns sl=&q
uot;http:/
/www.w3.org/1999/XSL/Transform">
<!-- Or replace it with .../html/chunk.xsl -->
<xsl:import
href="docbook-xsl-ns-snapshot/html/docbook.xsl"/&g
t;
<xsl:template match="d:datashoptip">
<!-- Insert your own changes -->
</xsl:template>
<xsl:template
match="d:datashoptip/d:title"/>
</xsl:stylesheet>
------------------------------------------------------------
-------
For details see html/admon.xsl. I think it should be easy,
as you need
just to copy some contents from the db:note|db:caution...
template.
Hope that helps,
Tom
[1] http://www.sagehill.net/docbookxsl/CustomMethods.html
[2] http://docb
ook.sourceforge.net/snapshots/
--
Thomas Schraitle
------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribe lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help lists.oasis-open.org
|