[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML tags as map keys and impact on XSLT/XPath
Hi,
At 06:14 AM 6/18/2010, Mike wrote: On 18/06/2010 07:28, Wolfgang Laun wrote:Every now and then, people (not me) want to represent a Map<K,V> in XML by using I agree: in general it's a poor way of using XML, and it makes it more difficult to process using XSLT. I agree with everything said in this thread so far (including Mike's analysis of where the system-level problems are in naming elements after values), but I hasten to add that the problems suggested for the XSLT may be overstated, at least if you allow for a little creativity: <xsl:key name="value-by-key" match="map/*" use="local-name()"/> While I wouldn't recommend this, I don't see it as entirely illegitimate either, especially if you allow that the format Wolfgang offers has a kind of bizarre elegance for the non-XML savvy user. Which is arguable, I know. :-) And sometimes it's the job of implementors to indulge the whims of designers. That being said, I'd probably go with a variant of Andrew's suggestion: <entry key="k1">v1</entry> <entry key="k2">v2</entry> <entry key="k3">v3</entry> Cheers, Wendell
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|