akatie / knitml

Automatically exported from code.google.com/p/knitml
0 stars 0 forks source link

unable to include a named pattern within another named pattern #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to writeup this simple pattern in KEL:
http://www.wingedsheep.com/blog/2009/01/14/double_dropped_scarf.html

This is the pattern as I wrote it in English:

    *  Cast on 25 stitches
    * Row 1-20: knit
    * Row 21: K1,* yo, yo, k1 * repeat to end of row
    * Row 22: K1,* Drop yo's, k1 * repeat to end of row
    * Row 23 - 28: knit
    * Repeat these 8 rows (rows 21 - 28) until scarf reaches desired length
Row N - N+20: knit (knit last 20 rows)
    * Bind off

This is the pattern as I *tried* to write it in KEL:

  Directions {             
      UseNeedle 'needle-size8Circular'
      CastOn 25 sts
      Instruction 'garter-st' {
        Row: k to end
      }
      Repeat 'garter-st' for 19 additionalTimes
      Instruction 'double-drop-pattern' {
        Row: K1, repeat to end { yo, yo, k1 }
        Row: K1, repeat to end { drop, drop, k1 } // see issue #5, this
line fails because its not in the library
        Repeat 'garter-st' for 6 additionalTimes // I can't repeat an
instruction within an instruction
      }
      Repeat 'double-drop-pattern' for 20 additionalTimes
      NextRow: BindOff all sts 
  }

This renders correctly in the XML view (i.e., I see that it states to
repeat the garter pattern within the double-drop pattern)

But when I go to the pattern view I get the following error:

Could not render pattern: exception is
com.knitml.renderer.common.RenderingException:
org.jibx.runtime.JiBXException: Expected
"{http://www.knitml.com/schema/pattern}instruction" end tag, found
"{http://www.knitml.com/schema/pattern}repeat-instruction" start tag (line
55, col 7) 
at
com.knitml.renderer.service.impl.RenderingServiceImpl.renderPattern(RenderingSer
viceImpl.java:22)

at
com.knitml.gpec.kel.editors.PatternViewControlContainer.doRenderPattern(PatternV
iewControlContainer.java:136)

version 0.2.0 on MacOSX

Original issue reported on code.google.com by jessica.sant on 19 Mar 2010 at 12:59

GoogleCodeExporter commented 9 years ago
I hadn't gotten around to allowing instructions within instructions due to some
technical complexities. I can take a look to see what it will take an provide an
estimate.

Original comment by fiddlerpianist@gmail.com on 29 Mar 2010 at 4:32

GoogleCodeExporter commented 9 years ago
To solve your instruction-within-instruction problem, try this:

Directions {             
      UseNeedle 'needle-size8Circular'
      CastOn 25 sts
      Instruction 'garter-st' {
        Row: k to end
      }
      Repeat 'garter-st' for 19 additionalTimes
      Instruction 'double-drop-pattern' {
        Row 1: K1, repeat to end { yo, yo, k1 }
        Row 2: K1, repeat to end { drop, drop, k1 } // see issue #5, this line fails
because its not in the library
        Row 3-8: k to end
      }
      Repeat 'double-drop-pattern' for 20 additionalTimes
      NextRow: BindOff all sts 
  }

Original comment by fiddlerpianist@gmail.com on 29 Mar 2010 at 4:37

GoogleCodeExporter commented 9 years ago
My apologies... the syntax is actually:

Row [3,4,5,6,7,8]: k to end

Original comment by fiddlerpianist@gmail.com on 29 Mar 2010 at 8:00

GoogleCodeExporter commented 9 years ago

Original comment by fiddlerpianist@gmail.com on 4 Nov 2011 at 4:24