XMetaL Tips and Tricks

XMetaL Community Forum XMetaL Tips and Tricks Script Example: Select Element Contents (without container tags)

  • Derek Read

    Script Example: Select Element Contents (without container tags)

    Participants 0
    Replies 1
    Last Activity 11 years, 5 months ago

    Products: XMetaL Author (Enterprise and Essential)
    Tested with XMetaL Author Enterprise,
    To provide this same feature in XMAX, integrate the same API into your XMAX solution.

    XMetaL Author Enterprise and Essential have an option listed on the Edit menu that lets an author select an element, including the tags. However, there is no built-in option to select all the content of a particular element without the tags.

    Provide an application-level macro that will let an author select the contents of the current element. In real usage this is probably most applicable to elements containing PCDATA and/or child elements but should also work for other node types (comments, PIs, etc). Because it is an application-level macro it should work for all document types.

    See attached screen capture if that description is not clear (demoSelectElementContents.png).

    * Licensed Materials – Property of JustSystems, Canada, Inc.
    * (c) Copyright JustSystems Canada, Inc. 2011
    * All rights reserved.
    * The sample contained herein is provided to you “AS IS”.
    * It is furnished by JustSystems Corporation as a simple example and has not been
    * thoroughly tested under all conditions. JustSystems Canada, Inc., therefore, cannot
    * guarantee its reliability, serviceability or functionality.
    * This sample may include the names of individuals, companies, brands and products
    * in order to illustrate concepts as completely as possible. All of these names are
    * fictitious and any similarity to the names and addresses used by actual persons or
    * business enterprises is entirely coincidental.

    1) Unzip attached file and place the MCR file it contains inside the folder AuthorStartup
    2) Restart XMetaL Author Enterprise or Essential.

    1) Place cursor (insertion point) inside an element, or select a portion of that element.
    2) Press Ctrl+Alt+T to select all of the element's content, not including the containing tags.

    1) Remove the MCR file you previously placed into the folder AuthorStartup
    2) Restart XMetaL Author Enterprise or Essential.

    Note: Our products will not cleanly uninstall themselves if they have been modified after installation (as with this example). So, if you do not remove this file prior to uninstalling then some folders may be left behind if you uninstall the product.



    Reply to: Script Example: Select Element Contents (without container tags)

    Good to hear. Really like this site. It makes me feel good to have people to share and to listen


  • You must be logged in to reply to this topic.

Lost Your Password?