Windows Scripting
  Home arrow Windows Scripting arrow Creating an XML Document in WSH
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Creating an XML Document in WSH
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-11-24

    Table of Contents:
  • Creating an XML Document in WSH
  • Microsoft’s XML Parser
  • Building the document tree
  • Extending the concept

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating an XML Document in WSH


    (Page 1 of 4 )

    An eXtensible Markup Language (XML) file is a simple text-based database system that has been gaining a lot of popularity. Records are stored in a plain text format using a series of custom tags to separate pieces of data. Originally designed for portability and compatibility, these files are becoming commonplace for software engineers and web developers.

    Today, I’m going to show you how to create XML files from within your WSH scripts. There are literally endless types of XML files out there. Among other things, they are often used for program configuration files, RSS feeds, web sites, and media playlists.

    I’ve chosen to create an XSPF (pronounced “spiff”) playlist. XSPF stands for XML Shareable Playlist Format, an open source play list format designed for its simplicity and portability. The XSPF specification is gaining popularity and is already supported by a number of different media players.  You can see an example playlist below.

    <?xml version="1.0" encoding="UTF-8"?>

    <playlist version="1" xmlns="http://xspf.org/ns/0/">

       <trackList>

           <track>

              <location>file:///URI/to/file.mp3</location>

              <title>Song Title</title>

              <creator>Artist or Band</creator>

              <info>http://link/to/additional/information</info>

              <album>Album Title</album>

              <trackNum>0</trackNum>

           </track>

           <track>

              <location>file:///URI/to/file.mp3</location>

              <title>Song Title</title>

              <creator>Artist or Band</creator>

              <info>http://link/to/additional/information</info>

              <album>Album Title</album>

              <trackNum>0</trackNum>

           </track>

       </trackList>

    </playlist>

    This is a very basic example of an XSPF playlist—just the bare necessities. A “playlist” element houses a track listing that is made up of multiple “track” elements. I won’t go into too much detail about the specification itself. It’s very simple to figure out, but you can find out more about XSPF by visiting the project home page.

    Are you ready to get your hands dirty and get down to code? I thought you might be.

    More Windows Scripting Articles
    More By Nilpo


     

    WINDOWS SCRIPTING ARTICLES

    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...
    - Modifying XML Files in WSH
    - Reading XML Files in WSH
    - Visual Basic 2005 XML Programming Using XML ...
    - Creating an XML Document in WSH
    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH

     
    Best Practices for Windows Vista Migration Presentation
    Dell and Microsoft recently held a series of face-to-face seminars entitled, &qu....

     
    Creating a Culture for Code Reuse
    If you oversee development teams you know that like it or not proprietary and ex....

     
    Keys to Web Application Acceleration: Advances in Delivery Systems
    Accelerate Web apps by up to 5x. Ensure significantly faster access to the Web a....

     
    Optimizing Application Monitoring
    Tired of finding out from your customers that you're offline? This white paper e....

     
    Solaris to Solaris Migration -- Migrating applications from Sun SPARC to Dell PowerEdge R900
    This comprehensive Migration Guide reviews the approach that Principled Technolo....

     




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT