Subject: Re: (dsssl) Dynamic defines From: Ron Ross <ronross@xxxxxxxxx> Date: 27 Feb 2001 05:27:20 -0500 |
Hi, I was following this thread and just realized that I do somewhat the same thing, using my own DTD, which has a "comment" element, not DocBook. The way I do it is to define a variable in my stylesheet having a boolean value #t/#f, which I toggle by declaring it on the command line to openjage (with the `-V' option). You could do this with the DocBook driver (I haven't used DocBook since 3.0 or something, but I imagine the mechanism hasn't changed). Defined as #f, as it is in the stylesheet, the comments don't appear, called on the command line they do. So you could simply do a `(define %draft% #f)', and then wrap the comment rule (and whatever other procedures you might want for draft output) in an `(if %draft% ...). Not quite the brainy programatic way of doing things, but it works for me;-). Cheers, Ron Devin Weaver <ktohg@xxxxxxxxxxxxx> writes: > I was wondering if there was a way to dynamically define a veriable > depending on the value of an attribute in the root tag. > > For an example (DocBook): > <?xml version="1.0"?> > <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" > "http://www.oasis-open/docbook/xml/4.1.2/docbookx.dtd"> > <book lang="en" id="book1" status="draft"> > <chapter id="ch1"> > <para>This is a para. <remark>This is a > comment.</remark></para> > <chapter> > </book> > > I want to (define %show-comments% #t) only if status="draft" > The problem is in my custom dsl the current-node has yet to be defined > so there is no way for me to get at the attributs of book. and even if > I did the root element can change. (Could be article, part, set, etc.) > > Anyone know how this could be done? > > -- > f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng. > > DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist > > DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: (dsssl) Dynamic defines, Jany Quintard | Thread | RE: (dsssl) Dynamic defines, Nilsson, Peter |
(dsssl) Alignment in a grid, Jan Scheffczyk | Date | Re: (dsssl) Dynamic defines, Devin Weaver |
Month |