<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for dazed</title>
	<atom:link href="http://www.dazed.de/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://www.dazed.de</link>
	<description>and sometimes confused.</description>
	<lastBuildDate>Mon, 04 Jan 2010 19:40:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Eclipse Xtext &#8211; parsing and merging multiple artifacts by Thomas Rohloff</title>
		<link>http://www.dazed.de/?p=107&#038;cpage=1#comment-307</link>
		<dc:creator>Thomas Rohloff</dc:creator>
		<pubDate>Mon, 04 Jan 2010 19:40:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.dazed.de/?p=107#comment-307</guid>
		<description>Your suggestions gave me enough of a hint to track down the issue.  I&#039;m not sure exactly why, but the file URI setup in the BulkReader was not properly processing my model files.  I changed to a toURI() function on File and my system is able to process the files.

private void addComponentForFile(File f) {
	String uri = null;
	uri = f.toURI().toString();

//Removed the following in favor of the toURI function
//	try {
//              	uri = URI.createFileURI(f.getCanonicalPath()).toFileString();
//	} catch (IOException e) {
//		e.printStackTrace();
//	}

.
.
.
	reader.setUri(uri);
	//Removed in favor of toURI function
	//reader.setUri(&quot;file:&quot;   uri);
.
.
.

There is one more change I had to make to get this to work.  The top level Element in the merged model appears to be something called &#039;List&#039;.  I had to make a top level definition for List and then Expand FOREACH Model.

«DEFINE main FOR List»
	«EXPAND declarations FOREACH this.typeSelect(Model)»
«ENDDEFINE»

«DEFINE declarations FOR Model»
	«EXPAND classDeclaration FOREACH this.declarations.typeSelect(ClassDeclaration)»
	«EXPAND partDeclaration FOREACH this.declarations.typeSelect(PartDeclaration)»
	«EXPAND productDeclaration FOREACH this.declarations.typeSelect(ProductDeclaration)»
«ENDDEFINE»</description>
		<content:encoded><![CDATA[<p>Your suggestions gave me enough of a hint to track down the issue.  I&#8217;m not sure exactly why, but the file URI setup in the BulkReader was not properly processing my model files.  I changed to a toURI() function on File and my system is able to process the files.</p>
<p>private void addComponentForFile(File f) {<br />
	String uri = null;<br />
	uri = f.toURI().toString();</p>
<p>//Removed the following in favor of the toURI function<br />
//	try {<br />
//              	uri = URI.createFileURI(f.getCanonicalPath()).toFileString();<br />
//	} catch (IOException e) {<br />
//		e.printStackTrace();<br />
//	}</p>
<p>.<br />
.<br />
.<br />
	reader.setUri(uri);<br />
	//Removed in favor of toURI function<br />
	//reader.setUri(&#8220;file:&#8221;   uri);<br />
.<br />
.<br />
.</p>
<p>There is one more change I had to make to get this to work.  The top level Element in the merged model appears to be something called &#8216;List&#8217;.  I had to make a top level definition for List and then Expand FOREACH Model.</p>
<p>«DEFINE main FOR List»<br />
	«EXPAND declarations FOREACH this.typeSelect(Model)»<br />
«ENDDEFINE»</p>
<p>«DEFINE declarations FOR Model»<br />
	«EXPAND classDeclaration FOREACH this.declarations.typeSelect(ClassDeclaration)»<br />
	«EXPAND partDeclaration FOREACH this.declarations.typeSelect(PartDeclaration)»<br />
	«EXPAND productDeclaration FOREACH this.declarations.typeSelect(ProductDeclaration)»<br />
«ENDDEFINE»</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Eclipse Xtext &#8211; parsing and merging multiple artifacts by admin</title>
		<link>http://www.dazed.de/?p=107&#038;cpage=1#comment-306</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 30 Dec 2009 18:08:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.dazed.de/?p=107#comment-306</guid>
		<description>Hello Thomas,

it definitly seems weird that the exception is only raised in the caller context of the bulk reader. There is one thread on the eclipse forums discussing a similar problem, just in case you haven&#039;t found it yet: 

http://www.eclipse.org/forums/index.php?t=msg&amp;goto=485116&amp;S=8e95881b48b5a3d8c28e7c07d4954c99

Don&#039;t know if this helps, though. Without paying attention to the MWE context I would say such a SAX exception could originate from a false XML encoding, so maybe you should try a different encoding.

Regards,

Andreas</description>
		<content:encoded><![CDATA[<p>Hello Thomas,</p>
<p>it definitly seems weird that the exception is only raised in the caller context of the bulk reader. There is one thread on the eclipse forums discussing a similar problem, just in case you haven&#8217;t found it yet: </p>
<p><a href="http://www.eclipse.org/forums/index.php?t=msg&#038;goto=485116&#038;S=8e95881b48b5a3d8c28e7c07d4954c99" rel="nofollow">http://www.eclipse.org/forums/index.php?t=msg&#038;goto=485116&#038;S=8e95881b48b5a3d8c28e7c07d4954c99</a></p>
<p>Don&#8217;t know if this helps, though. Without paying attention to the MWE context I would say such a SAX exception could originate from a false XML encoding, so maybe you should try a different encoding.</p>
<p>Regards,</p>
<p>Andreas</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Eclipse Xtext &#8211; parsing and merging multiple artifacts by Thomas Rohloff</title>
		<link>http://www.dazed.de/?p=107&#038;cpage=1#comment-304</link>
		<dc:creator>Thomas Rohloff</dc:creator>
		<pubDate>Tue, 29 Dec 2009 00:39:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dazed.de/?p=107#comment-304</guid>
		<description>I&#039;m trying to use MweBulkReader to parse and merge multiple model files written in a DSL defined with xText.  I feel like what I am doing should work, but I keep getting the following error: 
&quot;Skipping file because of exception org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.xml.sax.SAXParseException: Content is not allowed in prolog.&quot;  
Do you have any idea why I might be hitting this error?  I am able to call MWEReader directly from the MWE file to process my files one at a time, but not when I try to use the Bulk Reader.

Here is the contents of my MWE:


	
	
	
	
	
	 
		
		&lt;!-- this class has been generated by the xtext generator --&gt;
		 
		&lt;!-- uri value=&quot;file:${sourceFile1}&quot; / --&gt; 
		&lt;!-- uri value=&quot;file:${sourceFile2}&quot; / --&gt; 
		&lt;!-- sourceDirectory value=&quot;${sourcePath1}&quot; / --&gt; 
		 
		 
	
	
	
		
		
		
		
	



Here are the log messages:

0    [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  - --------------------------------------------------------------------------------------
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  - EMF Modeling Workflow Engine 0.7.2, Build v200908120417
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  - (c) 2005-2009 openarchitectureware.org and contributors
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  - --------------------------------------------------------------------------------------
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  - running workflow: C:/Users/trohloff/Documents/JavaProjects/NGC/ProductSpecsGen4/com.hp.ngc.xtext.generator/src/workflow/NGCLGenerator.mwe
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  - 
446  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri &#039;C:\Users\trohloff\Documents\JavaProjects\NGC\ProductSpecsGen4&#039;
581  [main] INFO  e.core.container.CompositeComponent  - DirectoryCleaner: cleaning directory &#039;src-gen/com/hp/ngc&#039;
582  [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning C:\Users\trohloff\Documents\JavaProjects\NGC\ProductSpecsGen4\com.hp.ngc.xtext.generator\src-gen\com\hp\ngc
583  [main] INFO  e.core.container.CompositeComponent  - MweBulkReader(ngc2model): Loading 1 resource
583  [main] INFO               workflow.MweBulkReader  - MweBulkReader(ngc2model): Registering models from path &#039;..\runtime-EclipseApplication\Model&#039;
587  [main] INFO               workflow.MweBulkReader  - MweBulkReader(ngc2model): Parsing file:...ProductSpecsGen4\runtime-EclipseApplication\Model\common.ngc into slot &#039;model_0&#039;
1411 [main] INFO               workflow.MweBulkReader  - MweBulkReader(ngc2model): Skipping file because of exception org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
1416 [main] INFO               workflow.MweBulkReader  - MweBulkReader(ngc2model): Parsing file:...roductSpecsGen4\runtime-EclipseApplication\Model\dl580g5.ngc into slot &#039;model_1&#039;
1455 [main] INFO               workflow.MweBulkReader  - MweBulkReader(ngc2model): Skipping file because of exception org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
1455 [main] INFO               workflow.MweBulkReader  - MweBulkReader(ngc2model): Skipping empty slot &#039;model_0&#039;
1455 [main] INFO               workflow.MweBulkReader  - MweBulkReader(ngc2model): Skipping empty slot &#039;model_1&#039;
1456 [main] INFO  e.core.container.CompositeComponent  - Generator: generating &#039;templates::Template::main FOR model&#039; =&gt; []
1586 [main] ERROR        org.eclipse.xpand2.Generator  - Error in Component  of type org.eclipse.xpand2.Generator: 
	EvaluationException : No Definition &#039;templates::Template::main for List&#039; found!
	[23,42] on line 1 &#039;EXPAND templates::Template::main FOR model&#039;

1589 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner  - Workflow interrupted. Reason: No Definition &#039;templates::Template::main for List&#039; found!
1590 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner  - [ERROR]: No Definition &#039;templates::Template::main for List&#039; found!(Element: EXPAND templates::Template::main FOR model; Reported by: Generator: generating &#039;templates::Template::main FOR model&#039; =&gt; [])</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to use MweBulkReader to parse and merge multiple model files written in a DSL defined with xText.  I feel like what I am doing should work, but I keep getting the following error:<br />
&#8220;Skipping file because of exception org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.xml.sax.SAXParseException: Content is not allowed in prolog.&#8221;<br />
Do you have any idea why I might be hitting this error?  I am able to call MWEReader directly from the MWE file to process my files one at a time, but not when I try to use the Bulk Reader.</p>
<p>Here is the contents of my MWE:</p>
<p>		<!-- this class has been generated by the xtext generator --></p>
<p>		<!-- uri value="file:${sourceFile1}" / --><br />
		<!-- uri value="file:${sourceFile2}" / --><br />
		<!-- sourceDirectory value="${sourcePath1}" / --> </p>
<p>Here are the log messages:</p>
<p>0    [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  &#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  &#8211; EMF Modeling Workflow Engine 0.7.2, Build v200908120417<br />
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  &#8211; (c) 2005-2009 openarchitectureware.org and contributors<br />
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  &#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  &#8211; running workflow: C:/Users/trohloff/Documents/JavaProjects/NGC/ProductSpecsGen4/com.hp.ngc.xtext.generator/src/workflow/NGCLGenerator.mwe<br />
10   [main] INFO  eclipse.emf.mwe.core.WorkflowRunner  &#8211;<br />
446  [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  &#8211; Registering platform uri &#8216;C:\Users\trohloff\Documents\JavaProjects\NGC\ProductSpecsGen4&#8242;<br />
581  [main] INFO  e.core.container.CompositeComponent  &#8211; DirectoryCleaner: cleaning directory &#8217;src-gen/com/hp/ngc&#8217;<br />
582  [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  &#8211; Cleaning C:\Users\trohloff\Documents\JavaProjects\NGC\ProductSpecsGen4\com.hp.ngc.xtext.generator\src-gen\com\hp\ngc<br />
583  [main] INFO  e.core.container.CompositeComponent  &#8211; MweBulkReader(ngc2model): Loading 1 resource<br />
583  [main] INFO               workflow.MweBulkReader  &#8211; MweBulkReader(ngc2model): Registering models from path &#8216;..\runtime-EclipseApplication\Model&#8217;<br />
587  [main] INFO               workflow.MweBulkReader  &#8211; MweBulkReader(ngc2model): Parsing file:&#8230;ProductSpecsGen4\runtime-EclipseApplication\Model\common.ngc into slot &#8216;model_0&#8242;<br />
1411 [main] INFO               workflow.MweBulkReader  &#8211; MweBulkReader(ngc2model): Skipping file because of exception org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br />
1416 [main] INFO               workflow.MweBulkReader  &#8211; MweBulkReader(ngc2model): Parsing file:&#8230;roductSpecsGen4\runtime-EclipseApplication\Model\dl580g5.ngc into slot &#8216;model_1&#8242;<br />
1455 [main] INFO               workflow.MweBulkReader  &#8211; MweBulkReader(ngc2model): Skipping file because of exception org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br />
1455 [main] INFO               workflow.MweBulkReader  &#8211; MweBulkReader(ngc2model): Skipping empty slot &#8216;model_0&#8242;<br />
1455 [main] INFO               workflow.MweBulkReader  &#8211; MweBulkReader(ngc2model): Skipping empty slot &#8216;model_1&#8242;<br />
1456 [main] INFO  e.core.container.CompositeComponent  &#8211; Generator: generating &#8216;templates::Template::main FOR model&#8217; =&gt; []<br />
1586 [main] ERROR        org.eclipse.xpand2.Generator  &#8211; Error in Component  of type org.eclipse.xpand2.Generator:<br />
	EvaluationException : No Definition &#8216;templates::Template::main for List&#8217; found!<br />
	[23,42] on line 1 &#8216;EXPAND templates::Template::main FOR model&#8217;</p>
<p>1589 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner  &#8211; Workflow interrupted. Reason: No Definition &#8216;templates::Template::main for List&#8217; found!<br />
1590 [main] ERROR eclipse.emf.mwe.core.WorkflowRunner  &#8211; [ERROR]: No Definition &#8216;templates::Template::main for List&#8217; found!(Element: EXPAND templates::Template::main FOR model; Reported by: Generator: generating &#8216;templates::Template::main FOR model&#8217; =&gt; [])</p>
]]></content:encoded>
	</item>
</channel>
</rss>
