- XML for people who doesn't like XML
- XML for flat people
- Because is new, and using new things is fun!
FlatXml can be explained in a few recipes.
Write
filter include="*.class" exclude="*.html"
instead of
<filter include="*.class" exclude="*.html" />
Write
task name="createFile"
{
create filename="newfile.txt"
}
instead of
<task name="createFile">
<create filename="newfile.txt" />
</task>
Write
property name="base.dir" value="/home/user"
instead of
<property name="base.dir">/home/user</property>
Write
$base.dir /home/user
as a shortcut for
property name="base.dir" value="/home/user"
Write
@author Noel
@version 0.1
@draft
or
meta-attr name="author" value="Noel"
meta-attr name="version" value="0.1"
meta-attr name="draft"
to define meta attributes.
# This is a comment
- Mix it during a few hours
- Add some tomato sauce
- Bake it on the oven
- After 30 minutes you'll have a fxml file ready to eat. Enjoy it!
string inFilename = "input.fxml";
Deserializer d = new Deserializer();
IEnumerable<FXmlElement> elements = d.Deserialize(File.OpenRead(inFilename));
if (elements == null)
{
PrintErrors(d.Errors);
return;
}
IEnumerable<FXmlElement> elements;
...
string outFilename = "output.fxml";
Serializer s = new Serializer();
Stream stream = s.Serialize(elements);
using (FileStream file = File.OpenWrite(outFilename))
{
stream.CopyTo(file);
}