Ticket #379 (closed task: fixed)
t:variable should support @mode="text|json|xml|html"
|Reported by:||mpo||Owned by:||mpo|
|Component:||-- unknown --||Version:|
Description (last modified by mpo) (diff)
t:variable will already use some clever automatic parsing of input to create the variable (Specially when it is loaded from @src: the mediatype of the received representation will be used to apply some magical parsing corresponding to the type.)
An extra @mode attribute should allow for end-users to override this default media-type driven behavior.
Modes to support:
- text: no parsing leave string as is (cdata)
- xml: perfom xml parsing and return a dom-tree
- html: same but apply nekohtml balancing
- json: parse into java-object
This is in fact a bit of a leftover from #361 (which contained many ideas)
As noted then:
Recent discussion in #358 adds more weight to the idea of having the suggested @mode="text" supported on t:variable too.
Reading json variables from @src and _not_ parsing them ever on the server-side, but simply injecting-transferring them out into the stream seems a common and wanted use case.