This discussion is archived
4 Replies Latest reply: Aug 24, 2006 9:51 AM by mdrake RSS

How do I use DTD's with XML DB ?

mdrake Expert
Currently Being Moderated
Assume I have an XML document containing a DOCTYPE that looks like this...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0">
<dict>
     <key>Major Version</key><integer>1</integer>
     <key>Minor Version</key><integer>1</integer>
     <key>Application Version</key><string>6.0.5</string>
     <key>Features</key><integer>1</integer>
     <key>Music Folder</key><string>file://localhost/C:/My%20Documents/My%20Music/iTunes/iTunes%20Music/</string>
     <key>Library Persistent ID</key><string>08072423C5C39B39</string>
     <key>Tracks</key>
     <dict>
          <key>113</key>
          <dict>
               <key>Track ID</key><integer>113</integer>
               <key>Name</key><string>Speak to Me/Breathe in the Air</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>David Gilmour/Nick Mason/Richard Wright/Roger Waters</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>9500202</integer>
               <key>Total Time</key><integer>237479</integer>
               <key>Track Number</key><integer>1</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:06:59Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B48</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/01%20Speak%20to%20Me-Breathe%20in%20the%20Air.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>115</key>
          <dict>
               <key>Track ID</key><integer>115</integer>
               <key>Name</key><string>On the Run</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>David Gilmour/Roger Waters</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>8480282</integer>
               <key>Total Time</key><integer>211983</integer>
               <key>Track Number</key><integer>2</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:06:59Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B49</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/02%20On%20the%20Run.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>117</key>
          <dict>
               <key>Track ID</key><integer>117</integer>
               <key>Name</key><string>Time</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>David Gilmour/Nick Mason/Richard Wright/Roger Waters</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>17007482</integer>
               <key>Total Time</key><integer>425168</integer>
               <key>Track Number</key><integer>3</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:06:59Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B4A</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/03%20Time.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>119</key>
          <dict>
               <key>Track ID</key><integer>119</integer>
               <key>Name</key><string>The Great Gig in the Sky</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>Richard Wright</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>11484657</integer>
               <key>Total Time</key><integer>287085</integer>
               <key>Track Number</key><integer>4</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:06:59Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B4B</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/04%20The%20Great%20Gig%20in%20the%20Sky.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>121</key>
          <dict>
               <key>Track ID</key><integer>121</integer>
               <key>Name</key><string>Money</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>Roger Waters</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>15343842</integer>
               <key>Total Time</key><integer>383582</integer>
               <key>Track Number</key><integer>5</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:00Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B4C</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/05%20Money.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>123</key>
          <dict>
               <key>Track ID</key><integer>123</integer>
               <key>Name</key><string>Us and Them</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>Richard Wright/Roger Waters</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>18756812</integer>
               <key>Total Time</key><integer>468897</integer>
               <key>Track Number</key><integer>6</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:00Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B4D</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/06%20Us%20and%20Them.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>125</key>
          <dict>
               <key>Track ID</key><integer>125</integer>
               <key>Name</key><string>Any Colour You Like</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>David Gilmour/Nick Mason/Richard Wright</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>8225302</integer>
               <key>Total Time</key><integer>205609</integer>
               <key>Track Number</key><integer>7</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:00Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B4E</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/07%20Any%20Colour%20You%20Like.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>127</key>
          <dict>
               <key>Track ID</key><integer>127</integer>
               <key>Name</key><string>Brain Damage</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>Roger Waters</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>9219097</integer>
               <key>Total Time</key><integer>230452</integer>
               <key>Track Number</key><integer>8</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:00Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B4F</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/08%20Brain%20Damage.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>129</key>
          <dict>
               <key>Track ID</key><integer>129</integer>
               <key>Name</key><string>Eclipse</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>Roger Waters</string>
               <key>Album</key><string>Dark Side of the Moon</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>5067312</integer>
               <key>Total Time</key><integer>126667</integer>
               <key>Track Number</key><integer>9</integer>
               <key>Year</key><integer>1973</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:00Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:26Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B50</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Dark%20Side%20of%20the%20Moon/09%20Eclipse.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>157</key>
          <dict>
               <key>Track ID</key><integer>157</integer>
               <key>Name</key><string>Shine on You Crazy Diamond, Pts. 1-5</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>David Gilmour/Richard Wright/Roger Waters</string>
               <key>Album</key><string>Wish You Were Here</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>32523642</integer>
               <key>Total Time</key><integer>813061</integer>
               <key>Track Number</key><integer>1</integer>
               <key>Year</key><integer>1975</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:14Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:33Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B51</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Wish%20You%20Were%20Here/01%20Shine%20on%20You%20Crazy%20Diamond,%20Pts.%201-5.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>159</key>
          <dict>
               <key>Track ID</key><integer>159</integer>
               <key>Name</key><string>Welcome to the Machine</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>Roger Waters</string>
               <key>Album</key><string>Wish You Were Here</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>17855766</integer>
               <key>Total Time</key><integer>446380</integer>
               <key>Track Number</key><integer>2</integer>
               <key>Year</key><integer>1975</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:14Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:33Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B52</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Wish%20You%20Were%20Here/02%20Welcome%20to%20the%20Machine.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>161</key>
          <dict>
               <key>Track ID</key><integer>161</integer>
               <key>Name</key><string>Have a Cigar</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>Roger Waters</string>
               <key>Album</key><string>Wish You Were Here</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>12320401</integer>
               <key>Total Time</key><integer>307983</integer>
               <key>Track Number</key><integer>3</integer>
               <key>Year</key><integer>1975</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:14Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:33Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B53</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Wish%20You%20Were%20Here/03%20Have%20a%20Cigar.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>163</key>
          <dict>
               <key>Track ID</key><integer>163</integer>
               <key>Name</key><string>Wish You Were Here</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>David Gilmour/Roger Waters</string>
               <key>Album</key><string>Wish You Were Here</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>13609931</integer>
               <key>Total Time</key><integer>340218</integer>
               <key>Track Number</key><integer>4</integer>
               <key>Year</key><integer>1975</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:14Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:33Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B54</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Wish%20You%20Were%20Here/04%20Wish%20You%20Were%20Here.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
          <key>165</key>
          <dict>
               <key>Track ID</key><integer>165</integer>
               <key>Name</key><string>Shine on You Crazy Diamond, Pts. 6-9</string>
               <key>Artist</key><string>Pink Floyd</string>
               <key>Composer</key><string>David Gilmour/Richard Wright/Roger Waters</string>
               <key>Album</key><string>Wish You Were Here</string>
               <key>Genre</key><string>Rock</string>
               <key>Kind</key><string>MPEG audio file</string>
               <key>Size</key><integer>29708412</integer>
               <key>Total Time</key><integer>742687</integer>
               <key>Track Number</key><integer>5</integer>
               <key>Year</key><integer>1975</integer>
               <key>Date Modified</key><date>2006-03-09T22:07:14Z</date>
               <key>Date Added</key><date>2006-08-24T05:24:33Z</date>
               <key>Bit Rate</key><integer>320</integer>
               <key>Sample Rate</key><integer>44100</integer>
               <key>Persistent ID</key><string>08072423C5C39B55</string>
               <key>Track Type</key><string>File</string>
               <key>Location</key><string>file://localhost/C:/My%20Documents/My%20Music/Pink%20Floyd/Wish%20You%20Were%20Here/05%20Shine%20on%20You%20Crazy%20Diamond,%20Pts.%206-9.mp3</string>
               <key>File Folder Count</key><integer>-1</integer>
               <key>Library Folder Count</key><integer>-1</integer>
          </dict>
     </dict>
     <key>Playlists</key>
     <array>
          <dict>
               <key>Name</key><string>Library</string>
               <key>Master</key><true/>
               <key>Playlist ID</key><integer>37</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B3A</string>
               <key>All Items</key><true/>
               <key>Playlist Items</key>
               <array>
                    <dict>
                         <key>Track ID</key><integer>113</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>115</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>117</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>119</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>121</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>123</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>125</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>127</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>129</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>157</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>159</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>161</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>163</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>165</integer>
                    </dict>
               </array>
          </dict>
          <dict>
               <key>Name</key><string>90’s Music</string>
               <key>Playlist ID</key><integer>40</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B3B</string>
               <key>All Items</key><true/>
               <key>Smart Info</key>
               <data>
               AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAA==
               </data>
               <key>Smart Criteria</key>
               <data>
               U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAEAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAB8YAAAAAAAAAAAAAAAAAAAAB
               AAAAAAAAB88AAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=
               </data>
          </dict>
          <dict>
               <key>Name</key><string>My Top Rated</string>
               <key>Playlist ID</key><integer>43</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B3C</string>
               <key>All Items</key><true/>
               <key>Smart Info</key>
               <data>
               AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAA==
               </data>
               <key>Smart Criteria</key>
               <data>
               U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkAAAAQAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAB
               AAAAAAAAADwAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=
               </data>
          </dict>
          <dict>
               <key>Name</key><string>Party Shuffle</string>
               <key>Playlist ID</key><integer>61</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B40</string>
               <key>Party Shuffle</key><true/>
               <key>All Items</key><true/>
               <key>Playlist Items</key>
               <array>
                    <dict>
                         <key>Track ID</key><integer>115</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>125</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>129</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>123</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>127</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>117</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>113</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>119</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>121</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>123</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>125</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>113</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>127</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>115</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>119</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>129</integer>
                    </dict>
               </array>
          </dict>
          <dict>
               <key>Name</key><string>Podcasts</string>
               <key>Playlist ID</key><integer>64</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B41</string>
               <key>Podcasts</key><true/>
               <key>All Items</key><true/>
          </dict>
          <dict>
               <key>Name</key><string>Recently Added</string>
               <key>Playlist ID</key><integer>52</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B3F</string>
               <key>All Items</key><true/>
               <key>Smart Info</key>
               <data>
               AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAA==
               </data>
               <key>Smart Criteria</key>
               <data>
               U0xzdAABAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAIAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABELa4tri2uLa7//////////gAAAAAACTqA
               La4tri2uLa4AAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=
               </data>
               <key>Playlist Items</key>
               <array>
                    <dict>
                         <key>Track ID</key><integer>113</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>115</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>117</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>119</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>121</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>123</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>125</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>127</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>129</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>157</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>159</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>161</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>163</integer>
                    </dict>
                    <dict>
                         <key>Track ID</key><integer>165</integer>
                    </dict>
               </array>
          </dict>
          <dict>
               <key>Name</key><string>Recently Played</string>
               <key>Playlist ID</key><integer>49</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B3E</string>
               <key>All Items</key><true/>
               <key>Smart Info</key>
               <data>
               AQEAAwAAAAIAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAA==
               </data>
               <key>Smart Criteria</key>
               <data>
               U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABcAAAIAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABELa4tri2uLa7//////////gAAAAAACTqA
               La4tri2uLa4AAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAA=
               </data>
          </dict>
          <dict>
               <key>Name</key><string>Top 25 Most Played</string>
               <key>Playlist ID</key><integer>46</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B3D</string>
               <key>All Items</key><true/>
               <key>Smart Info</key>
               <data>
               AQABAwAAABkAAAAZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAA==
               </data>
               <key>Smart Criteria</key>
               <data>
               U0xzdAABAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBAAACAAAAAAAAAAAAAAAAAAAAAAAA
               AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
               </data>
          </dict>
          <dict>
               <key>Name</key><string>Videos</string>
               <key>Playlist ID</key><integer>67</integer>
               <key>Playlist Persistent ID</key><string>08072423C5C39B42</string>
               <key>All Items</key><true/>
               <key>Videos</key><true/>
          </dict>
     </array>
</dict>
</plist>
For those who are interested it's a Libary.xml generated when you export your library from Apple's iTunes
  • 1. Re: How do I use DTD's will XML DB ?
    mdrake Expert
    Currently Being Moderated
    As the example below shows, when the database attempt to parse this document in order to create an XMLType the following error is returned.

    LPX-00202: could not open "http://www.apple.com/DTDs/PropertyList-1.0.dtd" (error 101)

    The cause of this error is that the XML Parser detects the presence of the DOCTYPE tag in the XML document and automatically switches into validating Mode. It then attempts to access the DTD at the specified URL. In this example there is a proxy server sitting between the database the outside world, so the XML Parser is unable to access the specified URL and the LPX-00202 is thrown.

    One solution to this is to configure database to use the Proxy Server. However

    However in general having to access content stored outside of the database when processing XML content inside the database is not a good idea. There are 2 main reasons for this.

    The first is performance, the time taken to access the external content will be much higher than the time taken to access content stored in the database.

    The second is security, it is possible for the URL to be spoofed meaning that the document returned by the HTTP operation may not be the correct document.
    etc going down or being spoofed..
    SQL> create or replace directory XMLDIR as 'c:\xdb\faq\example4'
      2  /
    
    Directory created.
    
    SQL> create table LIBRARY_XML of XMLType
      2  /
    
    Table created.
    
    SQL> insert into LIBRARY_XML values ( xmltype(bfilename('XMLDIR','Library.public.xml'),nls_charset_id('AL332UTF8')) )
      2  /
    insert into LIBRARY_XML values ( xmltype(bfilename('XMLDIR','Library.public.xml'),nls_charset_id('AL332UTF8')) )
                                     *
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00202: could not open "http://www.apple.com/DTDs/PropertyList-1.0.dtd" (error 101)
    Error at line 2
    ORA-06512: at "SYS.XMLTYPE", line 295
    ORA-06512: at line 1
    
    
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.createResource('/public/Library.xml',xmltype(bfilename('XMLDIR','Library.public.xml'),nls_charset_id('AL32UTF8')));
      5  end;
      6  /
    declare
    *
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    Error at line 2
    ORA-06512: at "SYS.XMLTYPE", line 295
    ORA-06512: at line 4
  • 2. Re: How do I use DTD's will XML DB ?
    mdrake Expert
    Currently Being Moderated
    One way to avoid this is to prevent the Parser switching into validating mode when it detects the presence of the DOCTYPE tag. This can be done by setting the following event..
    alter session set events ='31156 trace name context forever, level 2'
    /
    As can be seen, once this event has been set, the XMLType can now be constructed, even though the DOCTYPE tag is still present.
    SQL> alter session set events ='31156 trace name context forever, level 2'
      2  /
    
    Session altered.
    
    SQL> create or replace directory XMLDIR as 'c:\xdb\faq\example4'
      2  /
    
    Directory created.
    
    SQL> create table LIBRARY_XML of XMLType
      2  /
    
    Table created.
    
    SQL> insert into LIBRARY_XML values ( xmltype(bfilename('XMLDIR','Library.public.xml'),nls_charset_id('AL332UTF8')) )
      2  /
    
    1 row created.
    
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.createResource('/public/Library.xml',xmltype(bfilename('XMLDIR','Library.public.xml'),nls_charset_id('AL32UTF8')));
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
  • 3. Re: How do I use DTD's will XML DB ?
    mdrake Expert
    Currently Being Moderated
    If the DOCTYPE is a SYSTEM, rather than PUBLIC DOCTYPE, then XML DB treats the Path as being relative to the root of the XML DB repository.

    For instance, if the DOCTYPE looks like this
    <!DOCTYPE plist SYSTEM "/public/dtd/PropertyList-1.0.dtd">
    instead of like this
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
    Then the error message generated when the document is parsed becomes
    ORA-31001: Invalid resource handle or path name "/public/dtd/PropertyList-1.0.dtd"
    instead of
    LPX-00202: could not open "http://www.apple.com/DTDs/PropertyList-1.0.dtd"
    This is because the XML parser is now trying to locate the DTD as a resource in the XML DB repository.
    SQL> create or replace directory XMLDIR as 'c:\xdb\faq\example4'
      2  /
    
    Directory created.
    
    SQL> create table LIBRARY_XML of XMLType
      2  /
    
    Table created.
    
    SQL> insert into LIBRARY_XML values ( xmltype(bfilename('XMLDIR','Library.system.xml'),nls_charset_id('AL332UTF8')) )
      2  /
    insert into LIBRARY_XML values ( xmltype(bfilename('XMLDIR','Library.system.xml'),nls_charset_id('AL332UTF8')) )
                                     *
    ERROR at line 1:
    ORA-31001: Invalid resource handle or path name "/public/dtd/PropertyList-1.0.dtd"
    ORA-06512: at "SYS.XMLTYPE", line 295
    ORA-06512: at line 1
    
    
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.createResource('/public/Library.xml',xmltype(bfilename('XMLDIR','Library.system.xml'),nls_charset_id('AL32UTF8')));
      5  end;
      6  /
    declare
    *
    ERROR at line 1:
    ORA-31001: Invalid resource handle or path name "/public/dtd/PropertyList-1.0.dtd"
    ORA-06512: at "SYS.XMLTYPE", line 295
    ORA-06512: at line 4
    
    
    SQL>
  • 4. Re: How do I use DTD's will XML DB ?
    mdrake Expert
    Currently Being Moderated
    In this case loading the DTD into the appropraite location in the XML DB repository will resolve the problem. This can be done as follows
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.createFolder('/public/dtd');
      5    res := dbms_xdb.createResource('/public/dtd/PropertyList-1.0.dtd',bfilename('XMLDIR','PropertyList-1.0.dtd'));
      6    commit;
      7  end;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SQL>
    Once the DTD has been loaded documents that contain references to the DTD can now be processed successfully.
    SQL> create or replace directory XMLDIR as 'c:\xdb\faq\example4'
      2  /
    
    Directory created.
    
    SQL> create table LIBRARY_XML of XMLType
      2  /
    
    Table created.
    
    SQL> insert into LIBRARY_XML values ( xmltype(bfilename('XMLDIR','Library.system.xml'),nls_charset_id('AL332UTF8')) )
      2  /
    
    1 row created.
    
    SQL> declare
      2    res boolean;
      3  begin
      4    res := dbms_xdb.createResource('/public/Library.xml',xmltype(bfilename('XMLDIR','Library.system.xml'),nls_charset_id('AL32UTF8')));
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    Note that if the DOCTYPE tag contains no path, simple the name of the DTD, eg
    <!DOCTYPE plist SYSTEM "PropertyList-1.0.dtd">
    then XML DB would expect to find the DTD in the root of the XML DB repository. This would mean that the path passed to createResouce() would be '/PropertyList-1.0.dtd' and the resource could only be created by a user who had permission to create resources in the root of the repository. This would typically be system, or some other user who has been granted XDBADMIN.