Using special XML characters in DVD project files

If you get “Invalid Project XML” error from DVDBuilder, check your final DVD project XML. Often the reason for that error is a file path that contains characters that are allowed in file names, but are reserved in XML.

For example look at line 7 of the following DVD project:

<?xml version="1.0" encoding="utf-8"?>
<dvd version="2.3" xmlns="http://www.primosoftware.com/dvdbuilder/2.3">
    <videoManager firstPlayNavigate="Title=1;"/>
    <titleSet>
        <titles>
            <title id="1" chapters="00:00:00;">
                <videoObject file="c:\documents & settings\1.mpg" pause="10"/>
                <videoObject file="2.mpg" pause="0"/>
            </title>
        </titles>
    </titleSet>
</dvd>

The path in <videoObject file="c:\documents & settings\1.mpg" pause="10"/> contains the & reserved XML character.

The workaround is to xml-escape your file names. So in our case the DVD project XML should be changed to:

<?xml version="1.0" encoding="utf-8"?>
<dvd version="2.3" xmlns="http://www.primosoftware.com/dvdbuilder/2.3">
    <videoManager firstPlayNavigate="Title=1;"/>
    <titleSet>
        <titles>
            <title id="1" chapters="00:00:00;">
                <videoObject file="c:\documents &amp; settings\1.mpg" pause="10"/>
                <videoObject file="2.mpg" pause="0"/>
            </title>
        </titles>
    </titleSet>
</dvd>

We edited the file attribute of the first <videoObject> and replaced the & with &amp;.

There are five reserved XML characters that must be escaped. Here is a list of those characters:

" – U+0022 (34) – XML 1.0 double quotation mark. Escaped with &quot;

& – U+0026 (38) – XML 1.0 ampersand. Escaped with &amp;

' – U+0027 (39) – XML 1.0 apostrophe. Escaped with &apos;

< – U+003C (60) – XML 1.0 less-than sign. Escaped with &lt;

> – U+003E (62) – XML 1.0 greater-than sign. Escaped with &gt;


Blog Comments powered by Disqus.

Search