ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <dona...@apache.org>
Subject Re: [PATCH] valueFile for ReplaceFilter
Date Mon, 23 Apr 2001 12:51:08 GMT
At 09:42  23/4/01 +1000, Bojan Smojver wrote:
>Peter Donald wrote:
>
>> Just curious but why doesn't the following work for you if placed in your
>> style files. $mymenu.file could be a defined XSLT paramater (can the ant
>> style task pass in parameters??) or hardwired.
>> 
>>  <tag-enclosing-menu>
>>   <xsl:apply-templates select="document($mymenu.file)"/>
>>  </tag-enclosing-menu>
>
>The main reason is that the menu is a data file, not a stylesheet, it
>gets processed by the stylesheet so that every page gets different
>options on the menu.

right ;)

>And I'm not sure how would the above work in XSL. Can you enlighten me
>on the document() function. Didn't find it in the XPath spec...

I suspect document() must have been defined in XSLT spec though I don't
have it handy. Basically it loads a document from a url and from memory
returns reference to top level nodeset. (or it may be document root - can't
remember).

Thus "document(file:///home/donaldp/myfile.xml)" would load the file
/home/donaldp/myfile.xml from local file system and return it. Thus the
following statement saids to apply the template to the nodeset loaded from
file /home/donaldp/myfile.xml

<xsl:apply-templates select="document(file:///home/donaldp/myfile.xml)"/>

WHich in your case would load the menu data file and apply transforms -
which is exactly what you after I think ;)


Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


Mime
View raw message