[xmljs-users] New to xml, looking for some guidance
Brought to you by:
djoham,
witchhunter
|
From: Christopher B. <cb...@co...> - 2004-07-06 23:36:48
|
Hi xmljs-users,
I am very new to xml, and even newer to xml for <script>. I am very unsure of the best way to proceed, and would appreciate an insight, guidance, or cautions anyone can provide.
I am charged with updating the website for our academic department, and the only tool available to me is SSI (and javascript).
I have gotten the classic DOM to do what I would like, namely extract bits of info, depending on a tag id. I have several questions.
First, the method getElementById is quite useful. However, why is it that I cannot get an element based on some attribute other than id? For example, I have the following xml:
<faculty class="academic" id="sbeacon">
<name>Shirley Beacon</name>
<email>sb...@st...</email>
</faculty>
I can easily extract the node by domTree.getElementById('sbeacon'). But why not the more general 'getElementByAttribute', where I specify the attribute, and the value? This way I could easily extract all nodes having the same 'class' in this example. How could I do this? Does this question stem from my lack of knowledge of xml?
Second, is there a better way to organize my xml? I have 3 or 4 categories for what I'm calling 'class', and I would like to be able to group them (extract only academic, etc).
Third, how can I use html links within my xml document? Should I use a dummy character not likely to occur, and do a replace for the < and > signs? Is there a better way? I have read the documentation about the convertEscapes function, but as I understand it, this is intended for escaping the <'s and >'s in the xml tags themselves. I have tried using < and > in the html tag, and using convertEscapes on the extracted text, but this hasn't worked. Any suggestions?
Finally, browser compatibility is a concern for me. What browsers can handle the classic DOM?
Thank you. I am learning as I go, and any help is really greatly appreciated.
--
Chris |