Pages: 1
Print
Author Topic: Script Example: Select Element Contents (without container tags)  (Read 3134 times)
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2450



WWW
« on: August 15, 2011, 02:01:51 PM »

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

Background:
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.

Purpose:
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).

Legal:
* 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.
*---------------------------------------------------------------------

Installation:
1) Unzip attached file and place the MCR file it contains inside the folder <XMetaL install path>\Author\Startup\
2) Restart XMetaL Author Enterprise or Essential.

Usage:
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.

Uninstalling:
1) Remove the MCR file you previously placed into the folder <XMetaL install path>\Author\Startup\
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.


* demoSelectElementContents.png (56.95 KB, 1021x437 - viewed 567 times.)
* demo_selectElementContents.zip (0.89 KB - downloaded 290 times.)
« Last Edit: August 15, 2011, 02:05:11 PM by Derek Read » Logged
sectionfull
Member

Posts: 1


« Reply #1 on: December 06, 2013, 05:24:10 AM »

Good to hear. Really like this site. It makes me feel good to have people to share and to listen
Logged
Pages: 1
Print
Jump to:  

email us