Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.


/L12"NAnt" XML_LANG Noquote Block Comment On = <!-- Block Comment Off = --> File Extensions = build
/Delimiters = ~@$%^&*()+=|\{};"'<> ,
/Function String = "name=*">"
/Open Brace Strings = "{" "(" "[" "<"
/Close Brace Strings = "}" ")" "]" ">"
/C1"Elements" STYLE_ELEMENT
<code </code




Upload Error: Could not upload Attachment to ./uploads/forums/wordfile.rar.
<?xml version="1.0"?>
<project name="Ultraedit Wordfile Builder" default="buildwordfile">
<property name="wordfile.txt" value="wordfile.nant.txt" overwrite="false" />
<target name="buildwordfile">
<script language="C#" prefix="ue">
<imports>
<import namespace="System.Collections.Generic"/>
<import namespace="System.IO"/>
<import namespace="System.Text"/>
<import namespace="System.Xml" />
</imports>
<code>
<![CDATA[
[TaskName("wordfile")]
public class WordfileTask : Task {
#region Private Instance Fields
private string _wordfile="wordfile.txt";
private string _xsd="nant.xsd";
private string _message;
private SortedDictionary<String, String> elements = new SortedDictionary<String, String>();
private SortedDictionary<String, String> attributes = new SortedDictionary<String, String>();
#endregion Private Instance Fields
#region Private methods
private void parseXSD()
{
XmlDocument d = new XmlDocument();
d.Load(_xsd);
XmlNamespaceManager ns = new XmlNamespaceManager(d.NameTable);
ns.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
Console.WriteLine("boo");
XmlNodeList l = d.DocumentElement.SelectNodes("//xs:element", ns);
foreach(XmlNode n in l)
{
if (!elements.ContainsKey(n.Attributes["name"].Value.ToString()))
{
elements.Add(n.Attributes["name"].Value.ToString(), n.Attributes["name"].Value.ToString());
}
}
l = d.DocumentElement.SelectNodes("//xs:attribute", ns);
foreach (XmlNode n in l)
{
if (!attributes.ContainsKey(n.Attributes["name"].Value.ToString()))
{
attributes.Add(n.Attributes["name"].Value.ToString(), n.Attributes["name"].Value.ToString());
}
}
}
private void writeWordfile()
{
StreamWriter s = new StreamWriter("wordfile.txt");
s.WriteLine("/L13\"NAnt\" XML_LANG Noquote Block Comment On = <!-- Block Comment Off = --> File Extensions = build");
s.WriteLine("/Delimiters = ~@$%^&*()+=|\\{};\"'<> ,");
s.WriteLine("/Function String = \"name=*\">\"");
s.WriteLine("/Open Brace Strings = \"{\" \"(\" \"[\" \"<\"");
s.WriteLine("/Close Brace Strings = \"}\" \")\" \"]\" \">\"");
s.Write("/C1\"Elements\" STYLE_ELEMENT");
char c = '\0';
foreach(KeyValuePair<String,String> st in elements)
{
if (st.Value.IndexOf(c) != 0)
{
c = st.Value.ToCharArray()[0];
s.WriteLine("");
}
s.Write("<" + st.Value + " </" + st.Value + " <" + st.Value + "> </" + st.Value + "> ");
}
s.WriteLine("\n// />");
s.WriteLine(">");
s.WriteLine("<");
s.WriteLine("<%");
s.WriteLine("%>");
s.WriteLine("?>");
s.WriteLine("<? <?xml");
s.WriteLine("]]>");
s.WriteLine("<![CDATA[");
s.Write("/C2\"Attributes\" STYLE_ATTRIBUTE");
s.Flush();
foreach (KeyValuePair<String, String> st in attributes)
{
if (st.Value.IndexOf(c) != 0)
{
c = st.Value.ToCharArray()[0];
s.WriteLine("");
s.Flush();
}
s.Write(st.Value + "= ");
}
s.Close();
}
#endregion Private methods
#region Public Instance Properties
[TaskAttribute("wordfilePath", Required=true)]
public string FileName {
get { return _wordfile; }
set { _wordfile = value; }
}
[TaskAttribute("xsdPath", Required=true)]
public string XsdPath {
get { return _xsd; }
set { _xsd = value; }
}
#endregion Public Instance Properties
#region Override implementation of Task
protected override void ExecuteTask() {
parseXSD();
writeWordfile();
}
#endregion Override implementation of Task
}
]]>
</code>
</script>
<nantschema output="NAnt.xsd"/>
<wordfile wordfilePath="wordfile.txt" xsdPath="NAnt.xsd" />
</target>
</project>

