Kevin Flynn wrote:
> My CSS file contains the following, used for displaying links
> (cross-references) to other sections in the document:
>
> link:after{
> content: xpath("id(@id)/../title") "[" attr(type) "]" ;
> color: navy;
> text-decoration: underline;
> }
>
> and it works fine.
>
> However, if I run a transformation on a section of the file and paste the
> transformation results over the existing contents, then the section title
> returned by the xpath command in the CSS file is no longer displayed.
xpath() is evaluated once: when the view of the <link> element is created.
In XXE V2.9, you'll be able to write:
link:after{
content: label(xpath, "id(@id)/../title") "[" attr(type) "]" ;
color: navy;
text-decoration: underline;
}
Unlike xpath(), the label() content object is dynamic.
> I can manually correct the display by reloading the CSS file from the style
> menu. I imagined that I would be able to automate this by including a
> refresh or refresh/rebuild command in the macro that carries out the
> transformation. However, this does not appear to work. Does the refresh
> command not reload the CSS file? Is there another command that does this?
Use a macro-command containing:
* Your process command + everything else you need to do.
* "cancelSelection" See
http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch06s05.html
* "refresh rebuild[implicitDocument]" See
http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch06s39.html
Not efficient, but it will do the job.