XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Representing the components of a string in XML --should delimiters be represented?

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


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS