### Basic XML Parsing in TypeScript Source: https://www.maxprograms.com/articles/xml_gap.html This snippet demonstrates how to perform basic XML parsing using the SAXParser and DOMBuilder from the TypesXML library. Ensure you have a catalog file and the example XML file available. ```typescript import { Catalog, DOMBuilder, SAXParser } from "typesxml"; const parser: SAXParser = new SAXParser(); const handler: DOMBuilder = new DOMBuilder(); const catalog = new Catalog('/pathTo/catalog.xml'); parser.setCatalog(catalog); parser.setContentHandler(handler); parser.setValidating(true); parser.parseFile("example.xml"); const document = handler.getDocument(); console.log(document.toString()); ``` -------------------------------- ### XLIFF Translation Unit Example Source: https://www.maxprograms.com/articles/analysis.html An example of a single translation unit in XLIFF format. It includes source text, a target translation, and alternative translations with match quality and origin information. ```xml Corporate Headquarters Casa Central de la Compañía Corporate Headquarters Casa Central de la Compañía "Corporate Headquarters" "Casa Central de la Compañía" ``` -------------------------------- ### Embedding GlossML in XLIFF Source: https://www.maxprograms.com/articles/glossml.html This example demonstrates how to embed a GlossML glossary within an XLIFF document, using a namespace prefix for GlossML elements. ```xml
... GlossML data ...
... XLIFF data ...
``` -------------------------------- ### TMX Translation Unit Example Source: https://www.maxprograms.com/articles/analysis.html This snippet shows a single translation unit within a TMX file, containing variants for English and Spanish. It demonstrates the structure used to store source and target segments. ```xml Corporate Headquarters Casa Central de la Compañía ``` -------------------------------- ### Sample Bilingual GlossML File Source: https://www.maxprograms.com/articles/glossml.html This snippet shows a basic bilingual glossary structure using GlossML, including terms and definitions in English and Spanish. ```xml Sample bilingual glossary structure the manner in which something is constructed estructura This entry doesn't refer to statistics as a science statistic a numerical fact or datum, esp. one computed from a sample estadística cuadro numérico de un hecho que se presta a la estadística ``` -------------------------------- ### Sample XLIFF File Structure Source: https://www.maxprograms.com/articles/xliff.html This snippet demonstrates a sample XLIFF file generated from an HTML document, containing translation units with source text. ```xml
A Title One paragraph
``` -------------------------------- ### Simple HTML Page Structure Source: https://www.maxprograms.com/articles/xliff.html This snippet shows the basic structure of an HTML page with a title and a paragraph, intended for text extraction. ```html A Title

One paragraph

``` -------------------------------- ### Skeleton File for HTML Page Source: https://www.maxprograms.com/articles/xliff.html This snippet represents a skeleton file for an HTML page, where translatable text is replaced by placeholder marks (%%%1%%%, %%%2%%%). ```html %%%1%%%

%%%2%%%

``` -------------------------------- ### Annotate TMX File with Terminological Data Source: https://www.maxprograms.com/articles/tmx.html This TMX file demonstrates how to include terminological information such as administrative status, term type, usage notes, and general notes within glossary entries. ```xml
admittedTerm-admn-sts entryTerm Colloquial use term Informal salutation Hello admittedTerm-admn-sts entryTerm Termino de uso coloquial Saludo informal Hola ``` -------------------------------- ### DITA Topic with Conref Attributes Source: https://www.maxprograms.com/articles/cat_tools.html This DITA task topic demonstrates the use of the 'conref' attribute to reference elements from another DITA file. It highlights how content can be dynamically included from external sources. ```xml Applying XSL Transformation Open the document to transform. In menu, select . Select the appropriate XSL Stylesheet Click the button. ``` -------------------------------- ### DITA Topic with Referenced UI Elements Source: https://www.maxprograms.com/articles/cat_tools.html This DITA concept topic contains UI element definitions that are referenced by 'conref' attributes in other DITA files. It serves as a central repository for UI text snippets. ```xml UI Elements

Transformation: program menu that contains all transformation options.

XSL Transformation: applies an XSL Stylesheet to an XML document.

Apply Transformation: applies the selected XSL Stylesheet to the current open document.

``` -------------------------------- ### XLIFF Translation Unit with Pre-translation Matches Source: https://www.maxprograms.com/articles/xliff.html This XLIFF translation unit shows pre-translation results from a TM Search. It includes two `` elements, one with 100% match quality and another with 96% quality due to differences in markup between HTML and RTF sources. ```xml This is bold text This is bold text Este es texto enfatizado This is \bbold\b0 text Este es texto \benfatizado\b0 ``` -------------------------------- ### XLIFF Inline Elements for HTML and RTF Markup Source: https://www.maxprograms.com/articles/xliff.html This snippet shows how HTML and RTF formatting codes are represented using XLIFF inline elements and . It demonstrates the structure for both versions of a sentence. ```xml 1: This is <b> bold </b> text 2: This is \b bold \b0 text ``` -------------------------------- ### Protecting Inline Untranslatable Text with `` and `conref` Source: https://www.maxprograms.com/articles/cat_tools.html For untranslatable text within a sentence, use a `` element with an `id` in an untranslatable container (like ``) and reference it using `conref`. This ensures the surrounding text remains translatable while the specific phrase is protected. ```XML Untranslatable Title

This sentence contains text.

untranslatable
``` -------------------------------- ### Marking a Paragraph as Untranslatable Source: https://www.maxprograms.com/articles/cat_tools.html Use the `translate="no"` attribute on block-level elements like `

` to prevent their content from being translated. This is useful for warnings or notices that should remain in their original language. ```XML

Warning: this text should not be translated.

``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.