Menu

#750 xml schema for description is invalid

0.91-alpha2
closed-fixed
5
2014-08-22
2010-09-03
owl128
No

example for a build file:
<project xmlns="http://nant.sf.net/release/0.91-alpha2/nant.xsd" name="a">
<description>my description</description>
</project>
This will note the text between the description tags as invalid.

I suggest to fix the content of nant.xsd file by one of the followings:

Replace: <xs:complexType name="NAnt.Core.Tasks.DescriptionTask">
by <xs:complexType name="NAnt.Core.Tasks.DescriptionTask" mixed="true">

or

replace the occurrences of <xs:element name="description" type="nant:NAnt.Core.Tasks.DescriptionTask" />
by <xs:element name="description" type="xs:string" />

Discussion

  • Dominik Guder

    Dominik Guder - 2010-09-05

    Hi,

    I stubled about this long time ago. There are some more tasks like the echo task if I remember correctly.
    Changing this in xsd file itself would be easy. But this xsd file is created automatically by nantschema task. So we need to find a way to resolve this there. But this was to much effort for me and I stopped in validating my build files with other tools than nant itself.

     
  • Ryan Boggs

    Ryan Boggs - 2010-09-13

    I'm trying to get familiar with xsd in general. From what I can see, the closest I can get to the mixed is with this:

    <xs:complexType name="Target" mixed="true">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:complexType name="NAnt.Core.Tasks.DescriptionTask">

    however, I don't know if that will resolve this issue.

    Thanks,
    Ryan

     
  • Anonymous

    Anonymous - 2011-07-07

    rmboggs:

    That would indeed shut it up - mixed=true is what you want to get a complextype to accept text content. However as pointed out by dogu, the schema is autogenerated. What is really needed is a change to the schema task to get it to apply a mixed content model when it generates xsd types for tasks, based on some criterion. Having only just viewed Nant source for the first time today, I don't have a clear idea how that might be accomplished.

    The Description task doesn't appear to do anything; maybe it would be as simple as adding a 'text' property to the description task, which should appear as a 'text' attribute in the build file? NAnt by convention seems not to use element content to express very much at all.

     
  • Ryan Boggs

    Ryan Boggs - 2011-07-08

    It's been awhile...

    I took a look in the source and I think I got it. It looks like an easy fix. One question, is there any other complex types that need this modification?

     
  • Ryan Boggs

    Ryan Boggs - 2011-07-08

    Nevermind, I set it up so setting more tasks with the mixed attribute is very easy. Will commit fix shortly.

     
  • Ryan Boggs

    Ryan Boggs - 2011-07-08
    • assigned_to: nobody --> rmboggs
    • status: open --> open-fixed
     
  • Ryan Boggs

    Ryan Boggs - 2011-07-08

    Fix committed.

     
  • Ryan Boggs

    Ryan Boggs - 2011-12-09
    • status: open-fixed --> closed-fixed
     
  • Ryan Boggs

    Ryan Boggs - 2011-12-09

    Forgot to close this.

     

Log in to post a comment.