[oXygen-user] Custom action to process a document and update an element?

Wendell Piez wapiez at wendellpiez.com
Mon Dec 2 09:43:28 CST 2013


Yes, I know about the hiding-the-entities method. (I once described it
on XSL-List as like putting your beer in a paper bag to get it into
the football game.)

I don't know why it makes me cringe -- especially since we're not
talking about a feature that is architecturally "correct" in any case.

Cheers, Wendell

Wendell Piez | http://www.wendellpiez.com
XML | XSLT | electronic publishing
Eat Your Vegetables

On Mon, Dec 2, 2013 at 9:32 AM, George Cristian Bina
<george at oxygenxml.com> wrote:
> Hi Wendell,
> For entities we were thinking to turn them into text before processing and
> make them back to entities after processing, for example
> &something;
> will be converted to
> &amp;something;
> and apply the reverse on the result.
> Best Regards,
> George
> --
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
> On 12/2/13, 4:22 PM, Wendell Piez wrote:
>> Hi,
>> On Thu, Nov 28, 2013 at 1:45 AM, Alex Jitianu <alex_jitianu at sync.ro>
>> wrote:
>>> Hello,
>>> One aspect of using XQuery Update is that it will discard the DOCTYPE
>>> and will also expand entities. So you might not end up with what you've
>>> expected. We're investigating ways on our part to compensate for this
>>> inherent losses.
>> Yes. The same issue arises of course using XSLT.
>> In the case of XSLT, I can imagine a post-process that would work by
>> performing a (non-XML) parse of the source document to scan for a
>> DOCTYPE declaration and for entity references, find the declarations
>> for the latter, and generate an XSLT near-identity transformation that
>> would serve as a post-process to restore them.
>> It wouldn't be perfect, as it would effectively normalize entity
>> references, and it would only work for entities that expand to single
>> characters. On the other hand it might be good enough for daily wear.
>> (I guess it would have to map all declared entities, not only those
>> used, since the results could conceivably include content not in the
>> source. It would also have to be optional, since there would be cases
>> when switching a document type or cleaning up entities might be the
>> point of the process.)
>> I would be sympathetic to those who felt this sort of complication
>> demonstrates that the functionality isn't a good idea in the
>> architecture. Certainly, it would be a good way to shoot yourself in
>> the foot.
>> Cheers, Wendell
>> _______________________________________________
>> oXygen-user mailing list
>> oXygen-user at oxygenxml.com
>> http://www.oxygenxml.com/mailman/listinfo/oxygen-user

More information about the oXygen-user mailing list