How about: convertEntitiesToCharacters/convertCharactersToEntities ?
Those are nice and descriptive, but a bit verbose/long. XPath is already hard to write, adding huge long identifiers to functions you actually need to call alot just makes this worse.
So, how about fromEntities/toEntities ? or replaceEntities/useEntities ?
I like putting the word Entities in there, because that's more descriptive of what is really going on than "string" vs. "string literal".
Let's try and list some alternatives with pros and cons:
Terminology Pro Con escape / unescape Used in some prog langs Confusion with DFDL escape schemes encode / decode Used for URIs Confusion with character set encoding stringToStringLiteral / stringLiteralToString Uses DFDL terminology Was not clear to Suman
How about decodeStringLiteral() and encodeAsStringLiteral() ?From: Suman Kalia <kalia@ca.ibm.com>
Regards
Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
To: dfdl-wg@ogf.org, dfdl-wg-bounces@ogf.org,
Date: 08/01/2013 15:56
Subject: Re: [DFDL-WG] Fw: Proposed Errata: New function dfdl:stringLiteralToStringSent by: dfdl-wg-bounces@ogf.org
Example: dfdl:outputValueCalc='{ fn:concat(../x, dfdl:stringLiteralToString("%NUL;")) }'
The proposed function stringLiteralToString and stringLiteralFromString are essentially equivalent to the escape and unescape function in other programming language.. I would suggest renaming the function to escape and unescape as they truly capture the semantics of proposed functionality.
Here are references to other programming languages that use escape and unescape function
http://php.net/manual/en/sqlite3.escapestring.php
http://www.w3schools.com/jsref/jsref_escape.asp
Suman Kalia
IBM Canada Lab
WMB Toolkit Architect and Development Lead
Tel: 905-413-3923 T/L 313-3923
Email: kalia@ca.ibm.com
For info on Message broker
http://www.ibm.com/developerworks/websphere/zones/businessintegration/wmb.html
From: Steve Hanson/UK/IBM@IBMGB
To: Suman Kalia/Toronto/IBM@IBMCA,
Date: 01/08/2013 10:31 AM
Subject: Fw: [DFDL-WG] Proposed Errata: New function dfdl:stringLiteralToString
Regards
Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
----- Forwarded by Steve Hanson/UK/IBM on 08/01/2013 15:31 -----
From: Mike Beckerle <mbeckerle.dfdl@gmail.com>
To: Steve Hanson/UK/IBM@IBMGB,
Cc: dfdl-wg@ogf.org, dfdl-wg-bounces@ogf.org
Date: 12/12/2012 18:14
Subject: Re: [DFDL-WG] Proposed Errata: New function dfdl:stringLiteralToString
My vote is From then To style, as in
dfdl:stringLiteralToString - new function
dfdl:stringToStringLiteral - renamed from dfdl:stringLiteralFromString
On Wed, Dec 12, 2012 at 1:02 PM, Steve Hanson <smh@uk.ibm.com> wrote:
Should name be dfdl:stringFromStringLiteral to mirror existing dfdl:stringLiteralFromString (or should the latter be dfdl:stringToStringLiteral - follows the Java toString() pattern) ?
Regards
Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
From: Steve Hanson/UK/IBM
To: Mike Beckerle <mbeckerle.dfdl@gmail.com>,
Cc: dfdl-wg@ogf.org, dfdl-wg-bounces@ogf.org
Date: 12/12/2012 17:20
Subject: Re: [DFDL-WG] Proposed Errata: New function dfdl:stringLiteralToString
Mike, should we disallow DFDL Character Class entities also ?
Regards
Steve Hanson
Architect, Data Format Description Language (DFDL)
Co-Chair, OGF DFDL Working Group
IBM SWG, Hursley, UK
smh@uk.ibm.com
tel:+44-1962-815848
From: Mike Beckerle <mbeckerle.dfdl@gmail.com>
To: dfdl-wg@ogf.org,
Date: 12/12/2012 15:40
Subject: [DFDL-WG] Proposed Errata: New function dfdl:stringLiteralToString
Sent by: dfdl-wg-bounces@ogf.org
Proposed Errata: The following function is provided to assist in creating data that contains characters expressed using DFDL String Literal syntax.
dfdl:stringLiteralToString($arg)
Returns a string constructed from the $arg string argument. If $arg contains syntax matching DFDL Character Entites syntax, then the corresponding characters are used in the result. Any characters in $arg not matching the DFDL Character Entities syntax remain unchanged in the result.
Note that DFDL Byte Value Entities are not allowed. It is a schema definition error if $arg contains syntax matching DFDL Byte Value Entities syntax.
Use this function when you need to create a value which contains characters for which DFDL Character Entities are needed. An example is to create data containing the NUL (character code 0) codepoint. This character code is not allowed in XML documents, including DFDL Schemas; hence, it must be specified using a DFDL Character Entity. Within a DFDL Expression, use this function to obtain a string containing this character.
Example: dfdl:outputValueCalc='{ fn:concat(../x, dfdl:stringLiteralToString("%NUL;")) }'
--
Mike Beckerle | OGF DFDL WG Co-Chair | Tresys Technologies
Tel: 781-330-0412
--
dfdl-wg mailing list
dfdl-wg@ogf.org
https://www.ogf.org/mailman/listinfo/dfdl-wg
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
--
Mike Beckerle | OGF DFDL WG Co-Chair | Tresys Technologies
Tel: 781-330-0412
--
dfdl-wg mailing list
dfdl-wg@ogf.org
https://www.ogf.org/mailman/listinfo/dfdl-wg
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
--
dfdl-wg mailing list
dfdl-wg@ogf.org
https://www.ogf.org/mailman/listinfo/dfdl-wg