Additional Information > ALD Namespaces
  
PTC ALD Namespaces
An PTC ALD namespace is simply a named collection of various types of PTC ALD tags. PTC ALD namespaces have been implemented with a view towards support for XML namespaces. From PTC ALD’s point of view, namespaces are synonymous with directories or folders and share many of the same properties:
they have a name
they can ‘contain’ tags of many types
they are hierarchical (i.e., they can be nested)
there is a unique address for each tag anywhere in the hierarchy
tags at different levels of the hierarchy can have the same names
tags can be addressed by name only, or may include full or partial namespace information
a namespace ‘search order’ determines which tag is chosen when the full tag address is not used
Namespaces can also used to organize tags (just like files are organized into folders) and features have been added to use this organization to promote reuse of sets of tags in different documents.
The purest way of creating a namespace is to simply create a namespace tag. This is done with the ttagmk macro and the .ns tag name extension, i.e. ttagmk "mytags.ns".
This macro creates an empty namespace tag called ‘mytags’, which contains no other tags. To add tags to the namespace, use the ttagmk macro again ttagmk "mytags:strm1.tx". This creates a text stream called ‘strm1’ within the ‘mytags’ namespace.
Each PTC ALD document has its own namespace search list; a list of up to ten namespaces that will be searched whenever a tag is referred to by anything other than a full tag address. By default, new documents and documents from previous versions of PTC ALD will have a search list that contains only the root namespace, ‘:’. This preserves the behaviour of all previous documents.
Although a full list of macros is out of scope of this document, the following list contains details of the most commonly used macros for the control of namespaces:
ttagmk
Create a new namespace tag or add other tags to an existing namespace.
tbrowse
View a list of tags a namespace contains: invoke the macro, select a namespace from the resulting dialog and click the Info tab for a list of the tag's children.
tnorder
Invoke the Namespace Search Order dialog box to change the order of the document's namespace search list.
tnappend
Add a namespace to the namespace search list.
tninsert
Insert a namespace into the namespace search list.
tnremove
Remove a namespace from the namespace search list.
tnclear
Empty the namespace search list.
tnsave
Save a namespace and its contents to a file.
tnload
Load a saved namespace and its contents into a document.
A full list of PTC ALD macros is contained in the Macro Language Reference. Please refer to the PTC ALD Help Center, accessed via the Help menu option.