Anyone have an idea where I could find the DTD that is used to validate Emby's XML's?
I'm trying to make use of XMLlint to hunt down my malformed XML that is causing things to go sideways.
Thanks ahead of time.
While I'd still like to get my hands a hold of Emby's DTD...looks like I might be able to get away with:
xmllint --dropdtd --noout "<PathToXML>\<NameOfXML>.xml" 2>Result.txt
If it's empty, it loosely validates...if it's not...something is wrong with the XML.
So now to write a AutoIt script to blast through things.
Blah...that didn't help me one bit...my script got tripped up on only a few files...and that was only because of Unicode char's in the name:
W:\TV Shows\Person of Interest (2011)\Season 02\metadata\02X11 - 2pR.xml
warning: failed to load external entity "file:///W:/TV%20Shows/Person%20of%20Interest%20(2011)/Season%2002/metadata/02X11%20-%202pR.xml"
W:\TV Shows\Hawaii Five-0 (2010)\Season 05\metadata\05X08 - Ka Hana Malu.xml
warning: failed to load external entity "file:///W:/TV%20Shows/Hawaii%20Five-0%20(2010)/Season%2005/metadata/05X08%20-%20Ka%20Hana%20Malu.xml"
W:\TV Shows\Hawaii Five-0 (2010)\Season 05\metadata\05X16 - Nanahu.xml
warning: failed to load external entity "file:///W:/TV%20Shows/Hawaii%20Five-0%20(2010)/Season%2005/metadata/05X16%20-%20Nanahu.xml"
W:\TV Shows\Hawaii Five-0 (2010)\Season 05\metadata\05X20 - 'Ike Hanau.xml
warning: failed to load external entity "file:///W:/TV%20Shows/Hawaii%20Five-0%20(2010)/Season%2005/metadata/05X20%20-%20'Ike%20Hanau.xml"
So lacking a DTD, or the logs pointing out what file is screwy...I'm back to trying oddball hacks to figure out something.
Here is the code I came up with thus far...which is thus far useless:
$sPathFolder = 'W:\TV Shows\'
$sErrorLog = ''
$aAllFiles = _FileListToArrayRec( $sPathFolder , '*.xml' , 1 , 1 , 0 , 2 )
For $ii = 1 To $aAllFiles
RunWait( @ComSpec & ' /c xmllint --dropdtd --noout "' & $aAllFiles[$ii] & '" 2>Result.txt' , @ScriptDir & '\Bin\' , @SW_HIDE )
$sBuffer = FileRead( @ScriptDir & '\Bin\Result.txt' )
FileDelete( @ScriptDir & '\Bin\Result.txt' )
If StringLen( $sBuffer ) > 0 Then
$sErrorLog &= $aAllFiles[$ii] & @CRLF
$sErrorLog &= $sBuffer & @CRLF
If StringLen( $sErrorLog ) > 0 Then
$sErrorFile = @ScriptDir & '\[Error Log] ' & @YEAR & '-' & @Mon & '-' & @MDAY & ' ' & @HOUR & '.' & @MIN & '.' & @SEC & '.txt'
FileWrite( $sErrorFile , $sErrorLog )
ShellExecute( $sErrorFile )
MsgBox( 0 , 'Finished:' , 'No problems found.' & @LF & 'Bye Bye' )
Requires files extracted in a bin folder:
That can be grabbed from:
Edited by Nologic, 19 October 2015 - 03:53 AM.