Ticket #379 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

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:1 Changed 3 years ago by mpo

  • Milestone set to 0.4

comment:2 Changed 3 years ago by mpo

  • Status changed from new to accepted
  • Description modified (diff)

comment:3 Changed 3 years ago by mpo

  • Status changed from accepted to closed
  • Resolution set to fixed

(In [1743]) fixes #379
Adding the requested @mode for the t:variant
In a way that it aligns with @mode in t:insert
Some renaming and stuff along the way

Note: See TracTickets for help on using tickets.