Give it a try and let me know what you think!
[ add comment ] ( 1 view ) | [ 0 trackbacks ] | permalink
After a bit of a hiatus to concentrate on a software release for work (and a nice vacation to the Pacific Northwest), I am now gearing up to release KnitML 0.3, hopefully within a week. Not only will it include a series of bug fixes and enhancements, but I hope to have a fully annotated schema as well as more documentation and formality of the new GroovyKnit syntax.
I'll certainly keep you posted.
[ add comment ] | [ 0 trackbacks ] | permalink
KnitML 0.2 has been released! New features include:
- support for multi-color knitting, including schema changes and a new color swatch sample KnitML file
- more complete internationalization support
- support for binding off
- Groovy support
- first cut of a knitting pattern domain-specific language - much shorter and more intuitive than coding XML directly
<row type="round">You can write it like this:
<repeat until="end">
<purl>1</purl>
<knit>2</knit>
<purl>1</purl>
</repeat>
</row>
<row type="round">
<repeat until="end">
<knit />
</repeat>
</row>
round { repeatToEnd { p 1; k 2; p 1 } }
round { knitToEnd() }
I'll do a separate posting about writing in this expression language, as there are a few quirks to know about the way Groovy expresses functions. Once you learn the rules, though, it's free sailing.Anyways, give the new release a go and let me know what you think!
[ 7 comments ] ( 56 views ) | [ 0 trackbacks ] | permalink
Now that you have hopefully had the chance to play with KnitML, I thought I'd blog a mini-series about each component to give you a better understanding of how everything works.
The core project provides building blocks for defining and parsing KnitML documents. This includes:
- XML schemas to define the KnitML syntax
- Knitting extensions to the JSR-275 Units specification
- Utilities for working with KnitML documents
The XML schemas
The XML schemas define the syntax of a KnitML document. This includes data type and data structure definitions. Data types are usually primitive values such as numbers, strings, and booleans (or subsets of these types), while data structure refers to the elements that can appear within the body of the element.
The body of the <knit> element can only contain a positive integer because it indicates the number of stitches to knit. This is an example of a data type definition. The body of the <needles> element, however, must contain one or more <needle> elements within it, and the ordering may be important. This is an example of a data structure definition.
You can validate the syntax of a KnitML document with most XML editors. The schema location information is located in the root element of the KnitML document (<pattern>). You can also perform syntactic validation by passing the
-checksyntax option to the knitml command line:knitml validatePattern pattern.xml -checksyntaxKeep in mind that syntactic validation is different from semantic validation. I'll cover semantic validation in my next post in this series.
The JSR-275 Units Specification
JSR-275 is a Java community effort which defines a standard measurement framework, and JScience provides a reference implementation for JSR-275. I have chosen to use this framework as a basis for converting knitting measurements between English and metric systems. KnitML Core extends upon JSR-275 to provide support for converting between US and standard needle sizes as well as definitions for gauge units (st/in, st/cm, row/in, row/cm).
Utilities
The utilities provide code support for common concepts used in other components. This includes common exceptions and enumerations, constants for XML elements and attributes, and parsing utilities. KnitML uses dom4j, a Java API for working with XML documents as an in-memory tree structure. KnitML Core builds on dom4j to provide additional support for KnitML-specific data type parsing, methods such as isKnittingOperation() and getGaugeForElement().
KnitML Core's dependencies
The KnitML Core project, like the rest of the KnitML projects, are built using Maven 2. This means that you can identify a project's dependencies on external components simply by examining the pom.xml file in the root directory of each component. KnitML depends on Commons Lang and Commons Collections, dom4j, and JScience. In the next release, KnitML will also depend on Spring Core and Spring Beans as these components provide XML schema resolution tools useful for offline schema lookups.
[ add comment ] | [ 0 trackbacks ] | permalink
This is a minor enhancement / bugfix release which provides the following functionality:
- Java 1.5 compatible
- Shell script for *nix environment (tested using Cygwin for Windows)
- Full featured validator no longer requires "needle1" and "needle2"
[ add comment ] | [ 0 trackbacks ] | permalink

Archives



