Philip Nye wrote:
> I am struggling with my stylesheets to get communication between the commands 
> in my config file and the view generated by my stylesheet. I can pass values 
> to a macro command but I cannot display use the results in generated content 
> unless they go into an attribute or element value.
> 
> Is there any way in generated content from my stylesheet that I can display 
> either a macro variable or a config file parameter or the result of a macro?

The only way to do that is to use Java system properties:



--> In configuration files, <property> elements are used to specify Java 
system properties. See 
http://www.xmlmind.com/xmleditor/_distrib/docs/configure/ch06s17.html



--> There is no native command to assign Java system properties. For 
now, you can use this horrible hack:

---
   <command name="setSystemProperty">
     <macro>
       <sequence>
         <get expression="sys:setProperty('%0','%1')"
              xmlns:sys="java:java.lang.System" />

         <command name="alert"
           parameter="previous value of '%0' was '%_'" />

       </sequence>
     </macro>
   </command>

   <binding>
     <keyPressed code="F2" />
     <command name="setSystemProperty" parameter="Hello 'beautiful 
world!'" />
   </binding>
---

Press F2 *twice* to see the macro at work. Remove "<command 
name="alert"..." for production use.



--> A Java system property can be referenced like that in the CSS style 
sheet:

---
@namespace sys "java:java.lang.System";

    ...


a[name]:after,
a[id]:after {
     content: icon(right-target) xpath("sys:getProperty('user.home')");
     color: gray;
     vertical-align: text-top;
}
---

See http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch07s02.html


Reply via email to