 |
 |
 |
steve.cpp wrote:
> Hi,
> I had a question about an example in Holzner's "XML: A Beginner's
> Guide." I have to learn XML quickly and picked up Holzner's book
> based on some colleagues advice, as well as on some online reviews. I
> have minimal experience with XML, or with JavaScript, so apologies if
> this is too easy.
>
> He has the following code posted as an example:
>
> <html>
> <head>
> <title>
> Retrieving data from an XML document.
> </title>
> <xml id="firstXML" src="hello.xml"></xml>
> <script language="JavaScript">
> function getData()
> {
> xmldoc = document.all("firstXML").XMLDocument;
>
> nodeDoc = xmldoc.documentElement;
> nodeGreeting = nodeDoc.firstChild;
>
> outputMessage = "Greeting: " +
> nodeGreeting.firstChild.nodeValue;
> message.innerHTML=outputMessage;
> }
> </script>
> </head>
>
> <body>
> <center>
> <h1>
> Retrieving data from an XML document.
> </h1>
>
> <div id="message"></DIV>
> <p>
> <input type="button" value="Read the greeting."
> onclick="getData()">
> </center>
> </body>
> </html>
Any book that gives this as an "example" of HTML should probably be set
aside. It's neither HTML nor XHTML, and it shows signs of having been
constructed by someone unfamiliar with the conventions of markup. The
fact that it might work in IE and nowhere else is likely to be
sufficient reason to discard it.
///Peter
--
XML FAQ: http://xml.silmaril.ie/
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |