Re[2]: [xmljs-users] New to xml, looking for some guidance
Brought to you by:
djoham,
witchhunter
From: Christopher B. <cb...@co...> - 2004-07-07 03:47:41
|
Hi David, DJ> The "id" tag is unique in XML. In ideal DJ> worlds, all "id" tags would be unique in an DJ> XML string. Thus, getElementById makes sense. DJ> Since "id" is the only attribute with this DJ> definition, a getElementByAttribute function DJ> doesn't make sense for an XML parser. However, DJ> if you need one, there is no reason why you DJ> couldn't just modify XML for <SCRIPT> to DJ> include it. All you would have to do is to DJ> clone the code in getElementById. I see. I had never thought to modify the script. Would it be difficult to have it return all of the nodes that match? I acknowledge your point about 'id' being ideally unique, but what about another attribute, for which several nodes share a common value? I imagine that this would be a quick way to organize data. I also imagine that this is what XPath is for? This is what I meant by my question about a better way to organize my data. Now that I know a bit more of the nomenclature, let me rephrase...Is a tag attribute a good way of categorizing groups of nodes, or should they all just be child nodes? From your example, I take it the latter? >> Third, how can I use html links within my xml <snip>... DJ> This is the ugly part of trying to do XML with DJ> javascript. <snip>... I see...Down & dirty. Sometimes there ain't no shortcuts. DJ> You're welcome. Good luck! Thank you for your thoughtful reply. -- Chris |