You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Angeshwar Deepak <an...@yahoo.com> on 2004/08/17 14:10:48 UTC

Passing value of property to site.xml???

Hi,

Is there any way to pass a value of property
to a site.xml file.

Something like

<site label="ForrestArticle" href=""
xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
<about label="Juna">
<level2 label="${component}">
	<logmessages label="Logmessages"
href="messages/logmessages.html"
....
....

Instead of

<site label="ForrestArticle" href=""
xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
<about label="Juna">
<level2 label="logging">
	<logmessages label="Logmessages"
href="messages/logmessages.html"
....
....

The value of property component is in my build file
and I want
to pass that value to the site instead of explicitly
specifying it.
In short I want my site.xml to behave like a build
file.
Is it possible to do such an approch?

bye,
with regards,
Deepak.



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

Re: Passing value of property to site.xml???

Posted by Charles Palmer <ch...@dspdesign.com>.
Perhaps this could also be dealt with by the XInclude mechanism, described
here: http://www.w3.org/TR/2004/CR-xinclude-20040413/ which should allow
flexible text substitution.

Problem is, I wasn't able to make it work myself - can anyone provide a
working example? I am copying here something from an earlier posting of mine
on this subject:

There is an entry here: http://forrest.apache.org/changes.html that says
this:

"Added XInclude capability to the documents. Remember to disable validations
for files with xincludes as the xinclude is not performed during validation.
(NKB)"

I added a new file (xi.xml) to the standard forrest seed files (in
src/documentation/content/xdocs/samples/) , with this snippet:

<p>
  <xi:include href="test.xml" xmlns:xi="http://www.w3.org/2001/XInclude" >
    <xi:fallback>
      If you see this, the include has failed.
    </xi:fallback>
  </xi:include>
</p>

I also disabled validation in forrest.properties. Something of the xi
process is working, because I get the fallback message printed. I've tried a
number of variations in terms of placing test.xml in different places,
referring to it with different hrefs, but no luck.

Would it be possible for somone to correct my sample, and provide a suitable
test.xml file and tell me where to put it, so I can make this example work.


Charles



Re: Passing value of property to site.xml???

Posted by Dave Brondsema <da...@brondsema.net>.
Angeshwar Deepak wrote:
> Hi,
> 
> Is there any way to pass a value of property
> to a site.xml file.
> 
> Something like
> 
> <site label="ForrestArticle" href=""
> xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
> <about label="Juna">
> <level2 label="${component}">
> 	<logmessages label="Logmessages"
> href="messages/logmessages.html"
> ....
> ....
> 
> Instead of
> 
> <site label="ForrestArticle" href=""
> xmlns="http://apache.org/forrest/linkmap/1.0" tab="">
> <about label="Juna">
> <level2 label="logging">
> 	<logmessages label="Logmessages"
> href="messages/logmessages.html"
> ....
> ....
> 
> The value of property component is in my build file
> and I want
> to pass that value to the site instead of explicitly
> specifying it.
> In short I want my site.xml to behave like a build
> file.
> Is it possible to do such an approch?
> 
> bye,
> with regards,
> Deepak.
> 
> 

You can have a preprocessing step that copies the file using ant's copy 
task and replacing tokens (eg @FOOBAR@) or use an XSLT stylesheet to 
transform the file.

-- 
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal