SGMLXML.net A place for SGML and XML application developers.

March 21, 2005

Darwin Information Typing Architecture (DITA)

Filed under: XML — cangione @ 11:23 pm




Introduction Article:
Summary:
  • Designed for Technical Documentation
  • Concept of a Topic as the main building block
  • Topic Reuse
  • Non-nesting structure of topics I highly agree with. Several advantages I see such as assured relevance when a topic is reused. Also helps with performance in certain situations.
  • Object-oriented concept
CA

March 18, 2005

Typography Issues Internationally

Filed under: XML — cangione @ 2:41 pm




For some more information about typography issues internationally, see http://www.oasis-open.org/cover/WD-XSLReq-19980511.html#AEN316 .

While it dates back to 1998 typography changes slowly so it is up to date.

March 16, 2005

Holes in Microsoft Office XML

Filed under: XML — @ 8:46 am







An interesting take on XML support in Office.


March 14, 2005

Unicode Character Reference Site

Filed under: XML — cangione @ 9:45 am




http://www.unicode.org/charts

March 11, 2005

Remove Trailing or Preceeding White Space from an Element

Filed under: REGEXP — cangione @ 2:32 pm




Trailing White Space:
[[:space:]]*</
Preceeding White Space:
<my>[[:space:]]*

Summary of regular expressions

Filed under: REGEXP — cangione @ 2:32 pm




Operator

Description

.

Any single character. Example: h.t matches hat, hit, hot and hut.

[ ]

Any one of the characters in the brackets, or any of a range of characters separated by a hyphen (-), or a character class operator (see below). Examples: h[aeiou][a-z] matches hat, hip, hit, hop, and hut; [A-Za-z] matches any single letter; x[0-9] matches x0, x1, …, x9.

[^]

Any characters except for those after the caret "^". Example: h[^u]t matches hat, hit, and hot, but not hut.

^

The start of a line (column 1).

$

The end of a line (not the line break characters). Use this for restricting matches to characters at the end of a line. Example: end$ only matches "end" when it’s the last word on a line, and ^end only matches "end" when it’s the first word on a line.

\<

The start of a word.

\>

The end of a word.

\t

The tab character.

\xdd

"dd" is the two-digit hexadecimal code for any character.

\( \)

Groups a tagged expression to use in replacement expressions. An RE can have up to 9 tagged expressions, numbered according to their order in the RE. The corresponding replacement expression is \x, for x in the range 1-9. Example: If \([a-z]+\) \([a-z]+\) matches "way wrong", \2 \1 would replace it with "wrong way".

*

Matches zero or more of the preceding characters or expressions. Example: ho*p matches hp, hop and hoop.

?

Matches zero or one of the preceding characters or expressions. Example: ho?p matches hp, and hop, but not hoop.

+

Matches one or more of the preceding characters or expressions. Example: ho+p matches hop, and hoop, but not hp.

\{count\}

Matches the specified number of the preceding characters or expressions. Example: ho\{2\}p matches hoop, but not hop.

\{min,\}

Matches at least the specified number of the preceding characters or expressions. Example: ho\{1,\}p matches hop and hoop, but not hp.

\{min,max\}

Matches between min and max of the preceding characters or expressions. Example: ho\{1,2\}p matches hop and hoop, but not hp or hooop.

\|

Matches either the expression to its left or its right. Example: hop\|hoop matches hop, or hoop.

 

Find all entities within a document

Filed under: REGEXP — cangione @ 2:32 pm




&[^;]*;

SED Replacement Command

Filed under: REGEXP — cangione @ 2:32 pm




sed -i 's/[reg expr that is]/[replacement]/g' [file(s)]

Show the command behind the menu item

Filed under: ACL — cangione @ 2:27 pm




Example:
eval menu_cmd(".Format.Modify Element in Context")

See what the Java class path is in Epics embedded JVM

Filed under: ACL — cangione @ 2:27 pm




Example:
 eval  java_static('java.lang.System', 'getProperty',     'java.class.path')

Searching a List for a Value in ACL

Filed under: ACL — cangione @ 2:27 pm




This provides a way of checking a value against a list.
Example:
$DOCTYPES["FOO//BAR//EN"] = 1
$DOCTYPES["FOO//BAR2//EN"] = 1
function check_doctype() {
$name=check_public_id();
if ($name in DOCTYPES) {
#DO SOMETHING
}
}

Return Unqiue Element Content

Filed under: ACL — cangione @ 2:27 pm




Notes:

  • Quick helper function when going after unique elements known to be present in a document.
  • No Error Handeling
  • If there are two of the same element only returns the first

Example:

function return_unique_element_content(elementname){

local status = oid_find_children(oid_null(), $arr, $elementname)

if ($status == 1) {

local elemoid = $arr[1]

local elemcontent = oid_content($arr[1]);

return $elemcontent

}

}

« Newer PostsOlder Posts »

Powered by WordPress