Holger Hartwig wrote:
> I have a xsl stylesheet which reads another document using the 
> document($filename,/) function. .
> 
> <xsl:variable name="file" select="document($filename,/)"/>
>   <xsl:apply-templates select="$file//@href"/>
> ...
> </xsl>
> 
> If I apply this stylesheet directly (from jedit using xalan), it works 
> fine.
> 
> But if I call it from xmlmind with a command  (defined in xslMenu.incl)
>  <command name="docb.tofileref">
>     <process>
>       <transform stylesheet="xsl/%{0}" file="%D" to="__fileref.xml" >
>         <parameter name="base.dir">%p/</parameter>
>       </transform>
>       <upload base="%{p}/">
>         <copyFile file="__fileref.xml" to="%{R}-fileref.xml" />
>       </upload>
>     </process>
>   </command>
> 
>   <command name="docb.listfileref">
>     <macro>
>       <sequence>
>     <command name="docb.tofileref" parameter='"%0"' />
>     <command name="XXE.open" parameter="%{p}/%{R}-fileref.xml" />
>       </sequence>
>     </macro>
>   </command>
> 
>  <menu>
>  ...
>    <item label="Listref ..."
>          command="docb.listfileref"
>      parameter='"listfileref.xsl"' />
>  </menu>

I don't understand where this $filename variable comes from. May be it 
is predefined in Xalan or automatically defined by jedit.

There is no such magic behavior in XXE+Saxon, please specify something 
like this:

---
   <command name="docb.tofileref">
      <process>
        <transform stylesheet="xsl/%{0}" file="%D" to="__fileref.xml" >
          <parameter name="base.dir">%p/</parameter>
          <parameter name="variable1">value1</parameter>
          <parameter name="variable2">value2</parameter>
          <parameter name="variable3">value3</parameter>
.
.
.
        </transform>
---

May be $filename needs to be defined this way?




> the processor can not read the file $filename. Any idea?
> BTW: is there a log file where the message output of the transformation?

Please right-click on the status bar and select "Command execution" from 
the combobox.




---
PS: Macro-commands have been *much* improved recently. Have you checked 
what you can do using new XPath-based constructs: get, set, test and match?
See http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch02s08.html
and http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch07.html


Reply via email to