forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <>
Subject Re: Sitemap dot xmap sourcetyping
Date Wed, 08 Jun 2005 07:37:16 GMT
David Crossley wrote:
> Maurice Lanselle wrote:


>>2) How does one construct "AND" classification rules?
>><sourcetype name="foo">
>>   <document-element local-name="foo"> && <document-element namespace="bar">
> I don't know if that is possible or needed. Perhaps there is another way.
> It would be better if you provided an actual use-case.

Using your example from earlier in this thread, AND would be:

 >   <sourcetype name="foo">
 >     <document-element local-name="foo">
 >   </sourcetype>
 >   <sourcetype name="bar">
 >     <document-element namespace="bar">
 >   </sourcetype>
 > ...
 > ...
 >       <map:when test="foo">
 >        <map:transform
 >           src="{project:resources.stylesheets}/foobar2document.xsl" />
 >       </map:when>
 >       <map:when test="bar">
 >        <map:transform
 >           src="{project:resources.stylesheets}/foobar2document.xsl" />
 >       </map:when>
 > ...

i.e. test for each individual action and duplicate the transform code. 
What duplicate code - that is bad (I herar you shout). You are of course 
correct, so the sitemap provides a thing called resources to allow the 
duplicate code to be refactored out and replaced with a 

(note the above example was directly copied for the suggestion for OR, 
obviously in an OR you would have different actions within the test)

See the simplified-docbook plugins input.xmap file for an example of the 
use of resources like this.


View raw message