You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Pasha Minallah <pa...@neptuneinc.org> on 2006/05/27 22:24:00 UTC

XInclude Problem: Fails to Produce Well-Formed Output

Hi,

We are currently using Cocoon 2.1.7 and attempting to migrate our applications
to 2.1.9.  Here is the main problem we've encountered in our testing of
XIncludeTransformer in 2.1.9.

*** Main Problem: Fails to Produce Well-Formed Output ***

Sitemap Snippet:

<map:generate src="web/content/home/index.xml"/>
<map:transform type="xinclude"/>
<map:serialize type="xml"/>

Pre-XInclude XML Snippet:

<section id="body">
  ...
  <section id="left-sidebars">
    <xi:include parse="xml" href="/opt/cocoon-2.1.9/build/webapp/smarte/web/content/home/menu.xml">
      <xi:fallback>
        <xi:include parse="xml" href="/opt/cocoon-2.1.9/build/webapp/smarte/web/content/common/main-menu.xml"/>
      </xi:fallback>
    </xi:include>
  </section>
  ...
</section>

Expected Output:

<section id="body">
  ...
  <section id="left-sidebars">
    <!-- Menu Content -->
  </section>
  ...
</section>

Actual Output:

<section id="body">
  ...
  <section id="left-sidebars">
    <!-- Menu Content -->
  </section>
  </xi:include>
  ...
</section>

Conclusion:

The closing xi:include tag without a corresponding opening tag makes the
output not well-formed.  Cocoon 2.1.7 produces the correct expected output.
This wouldn't be such a big deal if the output were displayed despite this
error but the browser bombs and displays the following ugly message:

XML Parsing Error: mismatched tag. Expected: </section>.
Location: http://localhost:8888/smarte/home/index.xml
Line Number 13, Column 13:</section></xi:include><section id="main-content">...

I pointed this problem out in Cocoon 2.1.8 as well, perhaps not in as much
detail.  I would urge you to at least restore the working code if fixing the
problem is going to take a while.

Thanks.

-- 
Pasha Minallah
Software Engineer
Neptune and Company, Inc.
http://www.neptuneandco.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Pasha Minallah <pa...@neptuneinc.org>.
On Monday 29 May 2006 23:40, Antonio Gallardo wrote:
>
> Thanks to Jason Johntson, this issue is now solved in our repository. It
> will be released in the next version. Also we added some test case to
> avoid a potential reversion in the future. If you want to use the fixed
> code now, please download 2.1.10-dev from our subversion repository.

Thank you, Jason and Antonio!  Much appreciated.

-- 
Pasha Minallah
Software Engineer
Neptune and Company, Inc.
http://www.neptuneandco.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Pasha,

Thanks to Jason Johntson, this issue is now solved in our repository. It 
will be released in the next version. Also we added some test case to 
avoid a potential reversion in the future. If you want to use the fixed 
code now, please download 2.1.10-dev from our subversion repository.

Thanks for reporting this issue.

Best Regards,

Antonio Gallardo.

Pasha Minallah escribió:
> Hi,
>
> We are currently using Cocoon 2.1.7 and attempting to migrate our applications
> to 2.1.9.  Here is the main problem we've encountered in our testing of
> XIncludeTransformer in 2.1.9.
>
> *** Main Problem: Fails to Produce Well-Formed Output ***
>
> Sitemap Snippet:
>
> <map:generate src="web/content/home/index.xml"/>
> <map:transform type="xinclude"/>
> <map:serialize type="xml"/>
>
> Pre-XInclude XML Snippet:
>
> <section id="body">
>   ...
>   <section id="left-sidebars">
>     <xi:include parse="xml" href="/opt/cocoon-2.1.9/build/webapp/smarte/web/content/home/menu.xml">
>       <xi:fallback>
>         <xi:include parse="xml" href="/opt/cocoon-2.1.9/build/webapp/smarte/web/content/common/main-menu.xml"/>
>       </xi:fallback>
>     </xi:include>
>   </section>
>   ...
> </section>
>
> Expected Output:
>
> <section id="body">
>   ...
>   <section id="left-sidebars">
>     <!-- Menu Content -->
>   </section>
>   ...
> </section>
>
> Actual Output:
>
> <section id="body">
>   ...
>   <section id="left-sidebars">
>     <!-- Menu Content -->
>   </section>
>   </xi:include>
>   ...
> </section>
>
> Conclusion:
>
> The closing xi:include tag without a corresponding opening tag makes the
> output not well-formed.  Cocoon 2.1.7 produces the correct expected output.
> This wouldn't be such a big deal if the output were displayed despite this
> error but the browser bombs and displays the following ugly message:
>
> XML Parsing Error: mismatched tag. Expected: </section>.
> Location: http://localhost:8888/smarte/home/index.xml
> Line Number 13, Column 13:</section></xi:include><section id="main-content">...
>
> I pointed this problem out in Cocoon 2.1.8 as well, perhaps not in as much
> detail.  I would urge you to at least restore the working code if fixing the
> problem is going to take a while.
>
> Thanks.
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Antonio Gallardo <ag...@agssa.net>.
Pasha Minallah escribió:
> On Saturday 27 May 2006 14:45, Jason Johnston wrote:
>   
>> This looks like the issue that caused issue 1489 to be reopened:
>>
>> http://issues.apache.org/jira/browse/COCOON-1489
>>
>> See in particular the linked mailing list message:
>> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=113639560121665&w=2
>>     
>
> Yes, I was redirected to issue 1489 when I pointed this problem out about 
> cocoon 2.1.8 in early January.  At the time, I was told the particular patch 
> mentioned in 1489 was applied to both 2.1.X and 2.2-dev branches.  Well, I'm 
> repeating myself to let the developers know that this continues to be an 
> issue in 2.1.9.
>
>   
Hi Pasha,

Would you send a patch? I will be glad to include it in cocoon. :-)

Best regards,

Antonio Gallardo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Antonio Gallardo <ag...@agssa.net>.
Jason Johnston escribió:
> Antonio Gallardo wrote:
>> Jason Johnston escribió:
>>> I've spent some time in the XIncludeTransformer before so I'll try 
>>> to come up with a fix this weekend.
>> Hi again,
>>
>> BTW, will be fine if you at the same time take care of 
>> http://issues.apache.org/jira/browse/COCOON-1753 :-)
>
> I attached a patch for that one back in February... what else needs to 
> be done?
Applied --> http://svn.apache.org/viewvc?view=rev&revision=409936

Best Regards,

Antonio Gallardo.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Antonio Gallardo <ag...@agssa.net>.
Jason Johnston escribió:
> Antonio Gallardo wrote:
>> Jason Johnston escribió:
>>> I've spent some time in the XIncludeTransformer before so I'll try 
>>> to come up with a fix this weekend.
>> Hi again,
>>
>> BTW, will be fine if you at the same time take care of 
>> http://issues.apache.org/jira/browse/COCOON-1753 :-)
>
> I attached a patch for that one back in February... what else needs to 
> be done?
ok. I will add this patch  now.

Best Regards,

Antonio Gallardo.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Jason Johnston <co...@lojjic.net>.
Antonio Gallardo wrote:
> Jason Johnston escribió:
>> I've spent some time in the XIncludeTransformer before so I'll try to 
>> come up with a fix this weekend.
> Hi again,
> 
> BTW, will be fine if you at the same time take care of 
> http://issues.apache.org/jira/browse/COCOON-1753 :-)

I attached a patch for that one back in February... what else needs to 
be done?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Antonio Gallardo <ag...@agssa.net>.
Jason Johnston escribió:
> I've spent some time in the XIncludeTransformer before so I'll try to 
> come up with a fix this weekend.
Hi again,

BTW, will be fine if you at the same time take care of 
http://issues.apache.org/jira/browse/COCOON-1753 :-)

Best Regards,

Antonio Gallardo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Jason,

Jason Johnston escribió:
> The testcase appears to test fallback to inline XML content, whereas 
> Pasha's issue involves fallback to another xi:include.  Can you create 
> one for the latter case as well?
>
>   <xi:include href="this_file_does_not_exist.xml">
>     <xi:fallback>
>       <xi:include href="this_file_exists.xml" />
>     </xi:fallback>
>   </xi:include>

I already did it. The pointer to cocoon-1489 blinded me. The problem is not

COCOON-1489. To fail it requires a nested xinclude into the fallback! It is a little different error. I wrote 1 more junit testcase to cover this issue ans it's failing as expected:

http://svn.apache.org/viewvc?view=rev&revision=409920



> I've spent some time in the XIncludeTransformer before so I'll try to 
> come up with a fix this weekend.
Great!

Best Regards,

Antonio Gallardo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Jason Johnston <co...@lojjic.net>.
Antonio Gallardo wrote:
> Pasha Minallah escribió:
>> On Saturday 27 May 2006 14:45, Jason Johnston wrote:
>>  
>>> This looks like the issue that caused issue 1489 to be reopened:
>>>
>>> http://issues.apache.org/jira/browse/COCOON-1489
>>>
>>> See in particular the linked mailing list message:
>>> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=113639560121665&w=2
>>>     
>>
>> Yes, I was redirected to issue 1489 when I pointed this problem out 
>> about cocoon 2.1.8 in early January.  At the time, I was told the 
>> particular patch mentioned in 1489 was applied to both 2.1.X and 
>> 2.2-dev branches.  Well, I'm repeating myself to let the developers 
>> know that this continues to be an issue in 2.1.9.
>>
>>   
> I added a junit testcase for COCOON-1489 and it pass. Would you like to 
> review it [1]?


The testcase appears to test fallback to inline XML content, whereas 
Pasha's issue involves fallback to another xi:include.  Can you create 
one for the latter case as well?

   <xi:include href="this_file_does_not_exist.xml">
     <xi:fallback>
       <xi:include href="this_file_exists.xml" />
     </xi:fallback>
   </xi:include>

I've spent some time in the XIncludeTransformer before so I'll try to 
come up with a fix this weekend.
--Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Antonio Gallardo <ag...@agssa.net>.
Pasha Minallah escribió:
> On Saturday 27 May 2006 14:45, Jason Johnston wrote:
>   
>> This looks like the issue that caused issue 1489 to be reopened:
>>
>> http://issues.apache.org/jira/browse/COCOON-1489
>>
>> See in particular the linked mailing list message:
>> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=113639560121665&w=2
>>     
>
> Yes, I was redirected to issue 1489 when I pointed this problem out about 
> cocoon 2.1.8 in early January.  At the time, I was told the particular patch 
> mentioned in 1489 was applied to both 2.1.X and 2.2-dev branches.  Well, I'm 
> repeating myself to let the developers know that this continues to be an 
> issue in 2.1.9.
>
>   
I added a junit testcase for COCOON-1489 and it pass. Would you like to 
review it [1]?

Best Regards,

Antonio Gallardo

[1] http://svn.apache.org/viewvc?view=rev&revision=409912

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Pasha Minallah <pa...@neptuneinc.org>.
On Saturday 27 May 2006 14:45, Jason Johnston wrote:
>
> This looks like the issue that caused issue 1489 to be reopened:
>
> http://issues.apache.org/jira/browse/COCOON-1489
>
> See in particular the linked mailing list message:
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=113639560121665&w=2

Yes, I was redirected to issue 1489 when I pointed this problem out about 
cocoon 2.1.8 in early January.  At the time, I was told the particular patch 
mentioned in 1489 was applied to both 2.1.X and 2.2-dev branches.  Well, I'm 
repeating myself to let the developers know that this continues to be an 
issue in 2.1.9.

-- 
Pasha Minallah
Software Engineer
Neptune and Company, Inc.
http://www.neptuneandco.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: XInclude Problem: Fails to Produce Well-Formed Output

Posted by Jason Johnston <co...@lojjic.net>.
This looks like the issue that caused issue 1489 to be reopened:

http://issues.apache.org/jira/browse/COCOON-1489

See in particular the linked mailing list message: 
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=113639560121665&w=2



Pasha Minallah wrote:
> Hi,
> 
> We are currently using Cocoon 2.1.7 and attempting to migrate our applications
> to 2.1.9.  Here is the main problem we've encountered in our testing of
> XIncludeTransformer in 2.1.9.
> 
> *** Main Problem: Fails to Produce Well-Formed Output ***
> 
> Sitemap Snippet:
> 
> <map:generate src="web/content/home/index.xml"/>
> <map:transform type="xinclude"/>
> <map:serialize type="xml"/>
> 
> Pre-XInclude XML Snippet:
> 
> <section id="body">
>   ...
>   <section id="left-sidebars">
>     <xi:include parse="xml" href="/opt/cocoon-2.1.9/build/webapp/smarte/web/content/home/menu.xml">
>       <xi:fallback>
>         <xi:include parse="xml" href="/opt/cocoon-2.1.9/build/webapp/smarte/web/content/common/main-menu.xml"/>
>       </xi:fallback>
>     </xi:include>
>   </section>
>   ...
> </section>
> 
> Expected Output:
> 
> <section id="body">
>   ...
>   <section id="left-sidebars">
>     <!-- Menu Content -->
>   </section>
>   ...
> </section>
> 
> Actual Output:
> 
> <section id="body">
>   ...
>   <section id="left-sidebars">
>     <!-- Menu Content -->
>   </section>
>   </xi:include>
>   ...
> </section>
> 
> Conclusion:
> 
> The closing xi:include tag without a corresponding opening tag makes the
> output not well-formed.  Cocoon 2.1.7 produces the correct expected output.
> This wouldn't be such a big deal if the output were displayed despite this
> error but the browser bombs and displays the following ugly message:
> 
> XML Parsing Error: mismatched tag. Expected: </section>.
> Location: http://localhost:8888/smarte/home/index.xml
> Line Number 13, Column 13:</section></xi:include><section id="main-content">...
> 
> I pointed this problem out in Cocoon 2.1.8 as well, perhaps not in as much
> detail.  I would urge you to at least restore the working code if fixing the
> problem is going to take a while.
> 
> Thanks.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org