[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-dev
Subject:    Re: [xml-dev] Representing the components of a string in XML -- should delimiters be represented?
From:       "Liam R. E. Quin" <liam () fromoldbooks ! org>
Date:       2023-02-26 17:09:34
Message-ID: 7100e1b89e90a656b40c738cbdcd503f76dbbe37.camel () fromoldbooks ! org
[Download RAW message or body]

On Sun, 2023-02-26 at 13:40 +0000, Roger L Costello wrote:
> 
> % and . are delimiters. Should they be represented in XML?

There's no single answer - it depends on your goals.

Examples -
* you're trying to compare different formatting languages.
  Some may use different delimiter characters, and you want
  to be able to calculate the relative frequencies of each.

So, you're interested in the syntax and need to capture it all.

* you want to convert calls to printf() to using your new
  XML-based function. So, you need to capture the behaviour.
  You don't need the actual delimiters, only the fact that
  there was one.

So, you're interested in replicating behaviour.

* you want to capture the relationships between the text
  and the objects being inserted.
  For example, given, "%d displaced people lost their %s", e1, e2,
  you want to track the expressions and use that to work out that
  e1 refers to "migrant children" and e2 refers to "employment badges",
  helping you to explore a database.

Software forensics. You don't need the delimiters or width specifiers.

* You want to extract strings for translation, potentially reordering
  the arguments to allow for language variants, and potentially
  adding new dependencies -
  "%s lost his %s"
  may become, in effect "%2 was lost by %1" in another language, and
  the spelling of (the translations of) "was" and "lost" might depend
  on the grammatical gender of the items or their quantity.

Localization, internationalization, natural language processing.

And so on.

In general if you can reconstruct the original input from your
representation, and it also meets all the needs you foresee, it's
probably adequate.

liam

-- 
Liam Quin,  https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:   http://www.fromoldbooks.org

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic