4 ms·
Exactly. If you do want to encode control characters, the way to do that would be as character entities (which are simply text like &) and handle the transl
by vivegi 4y ago
Exactly. If you do want to encode control characters, the way to do that would be as character entities (which are simply text like &) and handle the translation of these entities at the application level. As an example, if we want a newline to be removed for presentation (or translated into a newline symbol like in Microsoft Word), the right place to do that would be at the rendering time and not in the data representation layer (which is where XML operates).
You could also use tags, for example <br> tag in HTML.
After all it is Extensible Markup Language and the functionality for adding custom tags is the basic feature.
And as suggested above, base64 encoding and application level decoding is also an accepted practice.
All these techniques point to handling the rendering at the application level.
- smarks 4y ago> base64 encoding and application level decoding is also an accepted practice I feel seen. I remember suggesting this during a design discussion where the issue was how to embed an arbitrary document in another, where the embedded document could even be ill-formed. Everybody told me it was a gross and dirty hack and ignored the suggestion.
- vivegi 4y agoIt is quite a common pragmatic architectural pattern in the HTML architecture. For example, data urls where a MIME type representation is encoded in the URL format is used for embedding images and other MIME types. So, if one is building an application and needs to render a proprietary data object, this is a good way (not the only one) to handle it using a client library.