[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: indenting maps on write

Subject: Re: indenting maps on write
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 3 Apr 2024 11:22:42 -0000
Re:  indenting maps on write
On Wed, Apr 03, 2024 at 01:43:53AM -0000, Willem Van Lishout willemvanlishout@xxxxxxxxx scripsit:
> In my experience, this is hard to get right. It shows that XML attributes
> weren't really conceived with the idea to write code in them.
> 
> Some ideas:
> - Modify the XML parser to not do attribute normalisation (if possible
> in your environment)

That would not be viewed with favour.

> - Maybe try parsing the map using xsl:evaluate and reconstruct it?
> Although then you will probably encounter other issues, e.g. I believe
> key order is non-deterministic.

Yeah. The core issue here is to not set off false positiives from change
detection in a linewise, rather than node-aware, diff process in a
source control system. Any fragile special processing is not likely to
help in this respect.

> - Use <xsl:map>

Can't mark a variable defined using xsl:map as static, which I would at
least like to be able to do. (Which makes sense; the XPath map is text,
xsl:map contains a sequence constructor.)

> - Explain your colleagues how it works and tell them to live with it.

This would not appear to be a viable option.

I'm now wondering if I can hive all the variable definitions off into
a file I include but need not auto-update with the instance number.
That hasn't been an option before but I am no longer required to use SEF
files to deploy the transform.

Thanks!

-- Graydon

-- 
Graydon Saunders  | graydonish@xxxxxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.