Ticket #379 (closed task: fixed)
t:variable should support @mode="text|json|xml|html"
| Reported by: | mpo | Owned by: | mpo |
|---|---|---|---|
| Priority: | major | Milestone: | 0.4 |
| Component: | -- unknown -- | Version: | |
| Keywords: | Cc: | kauri-discuss@… |
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.
Change History
comment:2 Changed 3 years ago by mpo
- Status changed from new to accepted
- Description modified (diff)
comment:4 Changed 3 years ago by mpo
comment added to docs about this @mode
http://docs.outerthought.org/kauri-docs-current/195-kauri/g2/263-kauri.html