[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Representing the components of a string in XML --should de

  • From: "Liam R. E. Quin" <liam@fromoldbooks.org>
  • To: Roger L Costello <costello@mitre.org>, "xml-dev@l..." <xml-dev@l...>
  • Date: Sun, 26 Feb 2023 12:09:34 -0500

Re:  Representing the components of a string in XML --should de
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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.