xsl-list
[Top] [All Lists]

Re: [xsl] XML tags as map keys and impact on XSLT/XPath

2010-06-18 01:47:24
On Fri, Jun 18, 2010 at 11:58 AM, Wolfgang Laun 
<wolfgang(_dot_)laun(_at_)gmail(_dot_)com> wrote:
Every now and then, people (not me) want to represent a Map<K,V> in XML by 
using
s.th. like
  <map>
    <k1>v1</k1>
    <k2>v2</k2>
    ...
  </map>

I would prefer a structure like below:

<map>
   <entry>
      <key>k1</key>
      <value>v1</value>
   </entry>
   <entry>
      <key>k2</key>
      <value>v2</value>
   </entry>
</map>

your example would fail, if say there's a key like:
<1k>v1</1k>

(because, "1k" is not a valid XML name)


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--