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" />
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.
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
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
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.
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?
Nevermind, I set it up so setting more tasks with the mixed attribute is very easy. Will commit fix shortly.
Fix committed.
Forgot to close this.