Can not get the Requirement from the model. I have tried getAppliedStereotypes() but it still not works. The code is as the following:
[comment encoding = UTF-8 /]
[module maintest('http://www.eclipse.org/papyrus/sysml/1.4/SysML',
'http://www.eclipse.org/papyrus/sysml/1.4/SysML/Activities',
'http://www.eclipse.org/papyrus/sysml/1.4/SysML/Requirements',
'http://www.eclipse.org/uml2/5.0.0/UML')/]
[template public maintestClass(aPackage : Package)]
[comment @main /]
[file ((aPackage.name+'.m'), false, 'UTF-8')]
0000
[for (r : Requirements::Requirement| aPackage.packagedElement->filter(Requirements::Requirement))]
11111
[/for]
[/file]
[/template]
Also, from this page http://techqa.info/programming/question/35093700/cannot-access-sysml-stereotypes-and-their-properties-in-acceleo , I can get Requirement just by generate(re : Requirements::Requirement) but it can not meet the needs since I have to put some node values in model to the document, but this template cannot get the model information. Or maybe any solutions about getting the nodes information in model which only get the Requirement?