title
Products            Buy            Support Forum            Professional            About            Codec Central
 
Results 1 to 3 of 3

Thread: Write Metadata File is generating malformed xml

  1. #1

    Join Date
    Mar 2023
    Posts
    2

    Write Metadata File is generating malformed xml

    I'm getting similar issues to this one with malformed xml being generated via the Write Metadata File 'DSP effect' on R16.6.
    In my case, it's outputting an element under <IDTags> with start tag
    Code:
    <UFIDhttp:www.cddb.comid3taginfo1.html name="UFIDhttp://www.cddb.com/id3/taginfo1.html">
    Of course there is no such 'UFIDhttp' namespace prefix declared in the xml file.
    Unsuprisingly, adding an xslt results in an empty file.

    A 'Read Metadata File' doesn't read the file either.

    I can't use ID Tag processing DSP set to delete that tag before the XML Writer step, as I don't want to change those files I'm extracting the tags from (and I don't much fancy having to make copies of such files every time I need to do this), hence I'm running Write Metadata File on the back of a Test Conversion; my goal being to perform the corresponding 'Read Metadata File' in a subsequent conversion of [tag-less] wav versions of those files to flac.

    I have just upgraded to R2023-1-20, hoping that these bugs might have been fixed in the intervening years, but this malformed xml issue persists.

    Please could you fix this bug and output well-formed xml, to save me from having to write my own script, or from using another tool for extracting file meta info in order to generate such xml files.

    [A cheeky Enhancement Request on top: to be optionally able to include Artwork (base64-encoded, naturally) within these xml files, for when working with albums/discs/folders having a mixture of artwork across the files/tracks]

    Many thanks

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    43,854

    Re: Write Metadata File is generating malformed xml

    You can upload the source file and xml template?

  3. #3

    Join Date
    Mar 2023
    Posts
    2

    Re: Write Metadata File is generating malformed xml

    Hi,
    I've PM'd you a link to an example source file having that "UFIDhttp://www.cddb.com/id3/taginfo1.html" tag in it.

    The xsl template is not the underlying issue here; a subsequent 'Read Metadata File' doesn't read/apply the file generated by 'Write Metadata File' even when the 'Apply XSLT' field is left blank in both operations.

    That said, just fyi/in case it helps anyone else, here is the xsl I was planning to use with the subsequent 'Read Metadata File' in order to filter-out some unwanted elements and result in a simpler/smaller xml structure more like what is given in your help doc about 'Read Metadata File'.
    [I was going to make it add/default-in some tags such as AlbumArtist and the sorting-related tags if absent in the source file, but haven't got around to that yet... might do it once this bug is fixed]
    Code:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    	<xsl:output method="xml" encoding="utf-8"/>
    	<xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
    	<xsl:template match="AudioMetadata"><xsl:copy><xsl:apply-templates select="SourceFile"/></xsl:copy></xsl:template>
    	<xsl:template match="SourceFile"><xsl:copy><xsl:apply-templates select="IDTags"/></xsl:copy></xsl:template>
    	<xsl:template match="Tempo[.='0 BPM']|*[@name='Tempo'][.='0 BPM']|EncodingTool|*[starts-with(@name,'Encoding')]|*[starts-with(@name,'iTun')]|*[starts-with(@name,'Comment ')]|Encodedby|*[@name='Encoded by']|*[@name='UFIDhttp://www.cddb.com/id3/taginfo1.html']"/>
    	<xsl:template match="Year"><xsl:copy><xsl:apply-templates select="@*"/><xsl:value-of select="substring(.,1,4)"/></xsl:copy></xsl:template>
    </xsl:stylesheet>

    Thanks.

    [By the way, not sure why the hash (*) characters within the URLs in my original post got converted to asterisk (*) characters...]

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •