OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: AW: [docbook] external entities in docbook


If your list of replaceable things is short and stable, then adding to
the dtd is probably no big deal, but if you tend to add items, then you
probably don't want to change your dtd so often. Depending on the
features of the editor and other details of your situation, you could
write a macro that inserts the desired markup so the writer doesn't have
to do so much clicking. In XMetaL, you can add random things to the list
of elements and have a macro execute when that item is selected. So I
have items like "database table" in mine that causes the editor to
insert <database class="table">. If your editor doesn't do that, you
could also create a  menu or submenu of items that can be inserted.

As for the xslt, you could do this:

<xsl:template match="phrase[@role = 'ProductName']">
<!-- do something here -->
</xsl:template> 

And add other templates for other macros. Or maybe do this:

<xsl:template match="phrase[@role]">
<xsl:choose>
<xsl:when test="@role = 'ProductName'">
<!-- do something here -->
</xsl:when>
<xsl:when test"@role = 'SomethingElse'">
<!-- do something else here -->
<xsl:when>
</xsl:otherwise>
<!-- do something...maybe fail if you didn't want to get here:
<xsl:message terminate="yes">Uh oh!</xsl:message> -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>

David

> -----Original Message-----
> From: Geraint North [mailto:geraint@transitive.com] 
> Sent: Monday, November 19, 2007 7:50 AM
> To: Jirka Kosek
> Cc: Hinrich Aue; docbook@lists.oasis-open.org
> Subject: Re: AW: [docbook] external entities in docbook
> 
> Yes, that would also seem to work (although I'm not sure how 
> to write an XSLT template for it).  The reason I added my own 
> tags was so that they appeared in the list of elements in the 
> GUI, so that users could easily see which ones were available.
> 
> Thanks,
> 
> Geraint North
> Principal Engineer
> Transitive
> Maybrook House, 40 Blackfriars Street, Manchester M3 2EG, UK
> Phone: (+44) 161-836-2315    Fax: (+44) 161-836-2399   Cell: (+44)  
> 7980-708-215
> 
> 
> On 19 Nov 2007, at 13:29, Jirka Kosek wrote:
> 
> > Hinrich Aue wrote:
> >> This sounds tempting. I'm using docbook 4.
> >> I guess I have to adapt the DTD then, so the editor 
> (Serna) doesn't 
> >> complain.
> >
> > I think that better is not to modify DocBook schema (DTD) for such 
> > purposes. Instead of <ProductName/> you can use 
> > <phrase>ProductName</phrase> or <phrase role="ProductName"/>, ie.
> > leveraging existing DocBook element.
> >
> > --
> > ------------------------------------------------------------------
> >   Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
> > ------------------------------------------------------------------
> >        Professional XML consulting and training services
> >   DocBook customization, custom XSLT/XSL-FO document processing
> > ------------------------------------------------------------------
> >  OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
> > ------------------------------------------------------------------
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-help@lists.oasis-open.org
> 
> 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]