Remember the problems with the <${./attribute}> syntax in combination with XyPerl?
The explanation being that elements emitted from XyPerl were not seen by compose as real xml elements, but rather as macro’s.
Well in XPP V8.2 this is no longer necessarily true.
XPP V8.2
XPP V8.2 comes loaded with a ton of new and exciting stuff.
But one bit that often gets overlooked is called Marked Fragments.
According to the release notes, marked fragments have the following characteristics:
• Each marked fragment has a unique identifier, generated at run time.
• Each marked fragment can contain tags and XyMacros, which are
executed as if they were seen in the original content.
Marked Fragments can be called in from a macro to call in text coming from an external file. (exiting!)
But more important to us, we can now let XyPerl work in Marked Fragment mode.
Which means that if we emit xml elements from our XyPerl, we don’t have to redefine those as macro’s. Compose will simply pick up the definition for those from the IF spec.
But which also means that if we emit from XyPerl something like <citerefs rids=”citerefs”/>, and we defined citerefs as:
<ti;${./rids}>
things will still work. Because compose now treats the <citerefs/> as a real xml element and citerefs will become the current element, hence ${./rids} will return the word ‘citerefs’.
A test
The test document was very simple:
<doc rids="doc"><citerefs rids="this"><xyperl><doc/>
And the XX spec:

And the result in my V8.2 beta copy looked like:

First of all, in case you are wondering what these funny blue bits are that you see in the line editor window, well that is just another new feature of XPP 8.2 at work: generated text gets colored in the line editor.
The first citerefs you see in the line editor is sitting in the document itself and returns ‘this’ for both ${id} and ${./id}.
The second citerefs (the blue one) is really generated from XyPerl, but as we are using XyPerl in the Marked Fragment mode, compose now also returns ‘xyperl’ both for the ${id} and ${./id} form.
Just like when the citerefs element is part of the original document.
Just as promised and one less to thing to worry about.
Oh one last thing. XPP would not be XPP if this new Marked Fragment behavior is an on-demand one, hence the ‘m’ flag that can be seen in the expansion of the xyperl element. So don’t worry, your existing code will not break!

2 users commented on " The story of the current element version 8.2 "
Follow-up comment rss or Leave a TrackbackAnd now XPP 8.2C.1 has been released – so there is no excuse any more! I have ordered my copy already.
Chris
A bit disappointed that the marked fragment piece was not mentioned in the press release for XPP 8.2