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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - 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...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek