Menu

XML doesn't validate

Help
2008-04-15
2013-05-01
  • Laker Netman

    Laker Netman - 2008-04-15

    I'm using the following, simple config for the moment:
    <?xml version="1.0" standalone="yes"?>
    <subversionNotifyConfig xmlns="http://www.mckechney.com/SubversionNotifyConfig.xsd" LoggingLevel="DEBUG">
        <SVNConfig ExePath="C:\Program Files\Subversion\bin\svnlook.exe" />
        <MailServer Name="smtpServer" Username="svn" Password="" FromAddress="svn@mydomain.com" EMailSubjectTag="[SVN]"/>

        <ReproPathConfig controlledPaths="/">
            <MailTo EMailAddress="me@mydomain.com" EMailType="HTML" EMailSuppressionChar="~" CustomSubjectFormat="#user# - #fileNames#"/>

            <DefaultLogMessage Text="#user# has decided not to add a log message. Don't worry, severe punishment will be administered in short order."/>

            <CommitRequirements FailureMessage="Please add a commit message">
                <CommitRequirement Description="Any Text" Regex="\w" />
                <FileTypeExclusion Description="Thumbnail Database Files" FileNameRegex="Thumbs\.db" FailureMessage="Committing thumbnail databases is not allowed"/>
            </CommitRequirements>
        </ReproPathConfig>
    </subversionNotifyConfig>

    Validation fails with: Further elements required under element <subversionNotifyConfig>.

    Based on the documentation, I cannot determine what is missing.

    Thanks,
    Laker

     
    • mmckechney

      mmckechney - 2008-04-15

      I believe this may have been an error with the XSD. I have committed a new version (along with a new executable version) to the repository.
      You can grab both of them from here:
      xsd: http://svn-notify.svn.sourceforge.net/viewvc/\checkout*/svn-notify/trunk/SubversionNotify/bin/Debug/SubversionNotifyConfig.xsd
      exe: http://svn-notify.svn.sourceforge.net/viewvc/\
      checkout*/svn-notify/trunk/SubversionNotify/bin/Debug/SubversionNotify.exe

      I will post an "official" release of this code soon. You can also check out the readme file to see what has changed.

       
    • Laker Netman

      Laker Netman - 2008-04-18

      Okay, here's what I get when I validate now (using 1.4.5.0 and the XSD you posted:
      The XML data is invalid
      Attribute 'controlledPaths' is not allowed in element <ReproPathConfig>

      The relevant line in my doc is:
      <ReproPathConfig controlledPaths="/">

      FWIW, I do have a closing tag as well.

      Thanks,
      Laker

       
      • mmckechney

        mmckechney - 2008-04-21

        Laker,
        Ok, I think I know what is happening... In the schema, the elements inside the <ReproPathConfig> element are listed as <xs:sequence>. I looked it up and this means that they need to appear in their proper order in order for the schema to validate. Those that are set to minOccurs="0" can be absent, but the ones that are present need to be in proper order.

        Thankfully, when the program reads the XML, it doesn't care about order and reads the settings fine. I'm not sure how to get around the limitation. There doesn't appear to be an analagous schema setting that will allow un-ordered elements. Give your configuration file a try, if you have issues, the log file should give enough detail to let you know what is missing.

        I hope this helps,
        Mike

         
    • Laker Netman

      Laker Netman - 2008-04-23

      As long as the operations are working, then that's good enough. Making the application strictly adhere to the schema requirements sounds like it would cause more problems than it fixes. Thanks for looking into it.

      Laker

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.