Niels Grundtvig Nielsen wrote:
> A whole new task - develop a set of html files for use in a JHelp
> system. Aha, I thought, an ideal moment to pick up XML Edit again!
> 
> Context:
> 
> I've wrapped a few words in an anchor and used the URL picker to set the
> target. Saving and viewing the results in an external editor confirms
> that the file now includes
> <li><a href="start_confidential.html">confidential start</a> and
> AirportView GIS</li>
> 
> Observation:
> 
> In the external editor, right-clicking on a file-name in an .html file
> lets me open it directly. I had hoped that that the XXE "Go to opposite
> link end" might do something similar, but apparently not.
> 
> Question:
> 
> Can I easily open/move between files linked with <a href ...>? and if
> so, how.
> 

--> Yes. After you install the following macro, you can use it as follows:

[1] Click inside  <a href ...>

[2] Press F3.

[3] If it is an internal link (href="#..."), the command will show you 
the link target.

If it is an external link, the command will attempt to open the file 
pointed to in XXE.

If the file pointed to is already opened in XXE, the command will switch 
you to its window.



--> Please add the following macro to your customize.xxe (or better to a 
customization of the XHTML configuration -- see 
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/add_toolbar_buttons.html)

<binding>
   <keyPressed code="F3" />
   <command name="xhtml.editPage" />
</binding>

<command name="xhtml.editPage">
   <macro>
     <sequence>
       <test expression="$implicitElement/@href" />

       <choice>
         <sequence>
           <test expression="starts-with($implicitElement/@href, '#')" />

           <command name="xhtml.crossReference"
                    parameter="swap" />
         </sequence>

         <sequence>
           <get context="$implicitElement/@href"
                expression="resolve-uri(.)"/>

           <command name="XXE.edit" parameter="%_" />
         </sequence>
       </choice>
     </sequence>
   </macro>
</command>

Reply via email to