Sign In/My Account | View Cart  
advertisement

Article:
 Converting Between XML and JSON
Subject: #text should always work
Date: 2006-06-14 04:18:08
From: stefan@goessner.net
Response to: #text should always work

This is a good point. Unfortunately we cannot have both 'e' *and* 'e["#text"]' resulting in the same textual content.


I agree, that having always to use 'e["#text"]' for accessing an element's text generally is more consistent.


Frequently programmers know their xml/json structure and want to use the less verbose 'e' form, which is what you also mentioned.


A possible solution might be to let the user control behaviour by an additional configuration parameter.


Please note however, that there is only an 'e.text' when element 'e' has a child element 'text'.


No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Sponsored By: