WebDeveloper.com ®: Where Web Developers and Designers Learn How to Build Web Sites, Program in Java and JavaScript, and More!   
Web Developer Resource DirectoryWebDev Jobs  
Animated GIFs
CSS
CSS Properties
Database
Design
Flash
HTML
HTML 4.01 Tags
JavaScript
.NET
PHP
Reference
Security
Site Management
Video
XML/RSS
WD Forums
 Client-Side
  Development

    CSS
    Graphics
    HTML
    JavaScript
    XML
    Dreamweaver/FrontPage
    Multimedia
    Web Video
    General
    Accessibility

 Server-Side
  Development

    ASP
    Perl
    PHP
    .NET
    Java
    SQL
    Other

 Web Development
  Business Issues

    Business Matters
    Website Reviews

 E-Commerce
    Domain Names
    Search Engines

 Etc.
    Computer Issues
    Forum Software
    Feedback
    The Coffee Lounge



Script Downloads
GetPosition 2

Featured: May 9, 2008
Description: This code returns the position of a given element in a given container, relative to other elements of its type. Very useful for finding position indexes of list items, pictures, form items, and more.

Get Script

Hosting Search
Unix   Windows
PHP   Webmail

Sign up for the free WebDeveloper E-mail newsletter!


JupiterWeb Commerce
Partners & Affiliates
Partner With Us
Hurricane Shutters
Corporate Gifts
KVM Switches
Condos For Sale
GPS
Imprinted Promotions
PDA Phones & Cases
Auto Insurance Quote
Desktop Computers
Home Improvement
Compare Prices
Promote Your Website
GPS Devices
Boat Donations

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Web Devs:
Moonlight as a Game Developer and Win Cool Prizes by Accepting the RIA Run Challenge

Now, your mission--should you choose to accept: Take your shot at gaming stardom if you think you might have what it takes to build a cool RIA game and you could win an Xbox 360 or other fabulous prizes. Hurry! You only have until May 15, 2008 to enter. »

 
Article:
Leveraging Your Flash Development with Silverlight

You're not giving up Flash any time soon (and we don't blame you.) But if you could get your Flash application working in Silverlight, why wouldn't you? We show you the tools and techniques required to have your rockin' Flash application rolled for Silverlight. Learn more here. »

 
Article:
What Does it Take to Build the Best RIA?

With the proliferation of Rich Interactive Application (RIA) platform choices out there, you no longer have to take a one-size-fits-all approach to developing your next RIA application. Knowing the strengths (and weaknesses) of each platform can help you to decide the best RIA for your next application. »

 

XML Does It Your Way!
Part 3

by Scott Clark

ActiveX for the Masses

Whether or not you use Java or ActiveX to parse your XML document, you won't actually be presenting the XML document to the browser directly. What you'll do is point the ActiveX component (or Java applet) to the XML file, and, if you're using the ActiveX parser, to the XSL file as well:



<OBJECT ID="XSLControl"
CLASSID="CLSID:2BD0D2F2-52EC-11D1-8C69-0E16BC000000"
codebase="http://www.microsoft.com/xml/xsl/msxsl.cab"
style="display:none">
<PARAM NAME="documentURL" VALUE="article.xml">
<PARAM NAME="styleURL" VALUE="xs.xsl">
</OBJECT>
You'll need to define a division to target:
<DIV id=xslTarget>
</DIV>
And then, last but not least, you'll need to add a little scripting which tells the parser to display the XML page within the DIV target:
<SCRIPT FOR=window EVENT=onload>
var xslHTML = XSLControl.htmlText;
document.all.item("xslTarget").innerHTML = xslHTML;
</SCRIPT>

The MS Java XML Parser

If you think that the ActiveX parser is a bit imposing to use, don't dispair. The Java XML parser that has been shipping with MSIE4+ is also a handy little tool to use, especially since it's already on the system of everyone that's using MSIE4, and it won't have to be downloaded. Unlike the ActiveX parser, it doesn't have to use an XSL sheet to format the XML. Rather, it can use some proprietary HTML parameters for its formatting:

<applet code=com.ms.xml.dso.XMLDSO.class
width=100% height=25 id=xmldso MAYSCRIPT=true>
<PARAM NAME="url" VALUE="article.xml">
</applet>
<table id=table border=2 width=100%
datasrc=#xmldso cellpadding=5>
<thead>
	<th>Author
	<th>Title
	<th>Publisher
        <th>Pages
	<th>Price
</thead>
<tr>
  <td valign=top><div datafld=AUTHOR dataformatas=HTML></td>
  <td valign=top><div datafld=TITLE dataformatas=HTML></td>
  <td valign=top><div datafld=PUBLISHER dataformatas=HTML></td>
  <td valign=top><div datafld=PAGES dataformatas=HTML></td>
  <td valign=top><div datafld=PRICE dataformatas=HTML></td>
</tr>
</table>
It points to the same XML file (article.xml) that the ActiveX parser was using. Again, the DTD need not even be there as far as the Microsoft Java applet is concerned, but to create valid XML you must include it anyway. The TABLE is bound to a datasource which is actually the Java parser applet's ID. Further, each data cell in the table is bound to a "field" (datafld=PRICE) from the XML file, and it is displayed as HTML (dataformatas=HTML).

The MS Java XML Parser is extremely simple to set up, and the uses are virtually limitless. If Microsoft is trying to bribe us into using MSIE by including useful little applets like this with the browser, it's working. It's up to Java developers to create an equivelent applet (hopefully 100% compatible) for Netscape's Navigator.

[ < XML Does It Your Way!:
Part 2 (MSIE4 Does XML!) ]
[ XML Does It Your Way!:
Part 4 (XML References, Links and Tools) > ]




Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers