[jira] [Updated] (COCOON-2212) jx:attribute does not check name is correct before proceeding

2023-11-30 Thread Jira


 [ 
https://issues.apache.org/jira/browse/COCOON-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cédric Damioli updated COCOON-2212:
---
Fix Version/s: 2.3.1
   (was: 2.3.0)

> jx:attribute does not check name is correct before proceeding
> -
>
> Key: COCOON-2212
> URL: https://issues.apache.org/jira/browse/COCOON-2212
> Project: Cocoon
>  Issue Type: Improvement
>  Components: Blocks: Templating
>Affects Versions: 2.1.12, 2.2, 2.3.0
>Reporter: Kamal Bhatt
>Priority: Major
> Fix For: 2.3.1
>
> Attachments: JXtemplateAttributePatch
>
>
> Currently, jx:attribute does not validate that the name is correct before 
> generating attribute. This patch fixes this.
> Also, refactored the JXTemplateGeneratorTestCase



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] Assigned: (COCOON-2212) jx:attribute does not check name is correct before proceeding

2009-04-27 Thread Grzegorz Kossakowski (JIRA)

 [ 
https://issues.apache.org/jira/browse/COCOON-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Grzegorz Kossakowski reassigned COCOON-2212:


Assignee: (was: Grzegorz Kossakowski)

I don't plan to work on this issue in foreseeable future so I leave it 
unassigned.

 jx:attribute does not check name is correct before proceeding
 -

 Key: COCOON-2212
 URL: https://issues.apache.org/jira/browse/COCOON-2212
 Project: Cocoon
  Issue Type: Improvement
  Components: Blocks: Templating
Affects Versions: 2.1.12-dev (Current SVN), 2.2, 2.2-dev (Current SVN)
Reporter: Kamal Bhatt
 Fix For: 2.2-dev (Current SVN)

 Attachments: JXtemplateAttributePatch


 Currently, jx:attribute does not validate that the name is correct before 
 generating attribute. This patch fixes this.
 Also, refactored the JXTemplateGeneratorTestCase

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Assigned: (COCOON-2212) jx:attribute does not check name is correct before proceeding

2008-06-20 Thread Grzegorz Kossakowski (JIRA)

 [ 
https://issues.apache.org/jira/browse/COCOON-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Grzegorz Kossakowski reassigned COCOON-2212:


Assignee: Grzegorz Kossakowski

 jx:attribute does not check name is correct before proceeding
 -

 Key: COCOON-2212
 URL: https://issues.apache.org/jira/browse/COCOON-2212
 Project: Cocoon
  Issue Type: Improvement
  Components: Blocks: Templating
Affects Versions: 2.1.12-dev (Current SVN), 2.2, 2.2-dev (Current SVN)
Reporter: Kamal Bhatt
Assignee: Grzegorz Kossakowski
 Fix For: 2.2-dev (Current SVN)

 Attachments: JXtemplateAttributePatch


 Currently, jx:attribute does not validate that the name is correct before 
 generating attribute. This patch fixes this.
 Also, refactored the JXTemplateGeneratorTestCase

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (COCOON-2212) jx:attribute does not check name is correct before proceeding

2008-06-17 Thread Kamal Bhatt (JIRA)
jx:attribute does not check name is correct before proceeding
-

 Key: COCOON-2212
 URL: https://issues.apache.org/jira/browse/COCOON-2212
 Project: Cocoon
  Issue Type: Improvement
  Components: Blocks: Templating
Affects Versions: 2.1.12-dev (Current SVN), 2.2, 2.2-dev (Current SVN)
Reporter: Kamal Bhatt
 Fix For: 2.2-dev (Current SVN)


Currently, jx:attribute does not validate that the name is correct before 
generating attribute. This patch fixes this.

Also, refactors the JXTemplateGeneratorTestCase

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (COCOON-2212) jx:attribute does not check name is correct before proceeding

2008-06-17 Thread Kamal Bhatt (JIRA)

 [ 
https://issues.apache.org/jira/browse/COCOON-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kamal Bhatt updated COCOON-2212:


Attachment: JXtemplateAttributePatch

 jx:attribute does not check name is correct before proceeding
 -

 Key: COCOON-2212
 URL: https://issues.apache.org/jira/browse/COCOON-2212
 Project: Cocoon
  Issue Type: Improvement
  Components: Blocks: Templating
Affects Versions: 2.1.12-dev (Current SVN), 2.2, 2.2-dev (Current SVN)
Reporter: Kamal Bhatt
 Fix For: 2.2-dev (Current SVN)

 Attachments: JXtemplateAttributePatch


 Currently, jx:attribute does not validate that the name is correct before 
 generating attribute. This patch fixes this.
 Also, refactors the JXTemplateGeneratorTestCase

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (COCOON-2212) jx:attribute does not check name is correct before proceeding

2008-06-17 Thread Kamal Bhatt (JIRA)

 [ 
https://issues.apache.org/jira/browse/COCOON-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kamal Bhatt updated COCOON-2212:


Description: 
Currently, jx:attribute does not validate that the name is correct before 
generating attribute. This patch fixes this.

Also, refactored the JXTemplateGeneratorTestCase

  was:
Currently, jx:attribute does not validate that the name is correct before 
generating attribute. This patch fixes this.

Also, refactors the JXTemplateGeneratorTestCase


 jx:attribute does not check name is correct before proceeding
 -

 Key: COCOON-2212
 URL: https://issues.apache.org/jira/browse/COCOON-2212
 Project: Cocoon
  Issue Type: Improvement
  Components: Blocks: Templating
Affects Versions: 2.1.12-dev (Current SVN), 2.2, 2.2-dev (Current SVN)
Reporter: Kamal Bhatt
 Fix For: 2.2-dev (Current SVN)

 Attachments: JXtemplateAttributePatch


 Currently, jx:attribute does not validate that the name is correct before 
 generating attribute. This patch fixes this.
 Also, refactored the JXTemplateGeneratorTestCase

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: [jira] Created: (COCOON-2212) jx:attribute does not check name is correct before proceeding

2008-06-17 Thread Kamal

Kamal Bhatt (JIRA) wrote:

jx:attribute does not check name is correct before proceeding
-

 Key: COCOON-2212
 URL: https://issues.apache.org/jira/browse/COCOON-2212
 Project: Cocoon
  Issue Type: Improvement
  Components: Blocks: Templating
Affects Versions: 2.1.12-dev (Current SVN), 2.2, 2.2-dev (Current SVN)
Reporter: Kamal Bhatt
 Fix For: 2.2-dev (Current SVN)


Currently, jx:attribute does not validate that the name is correct before 
generating attribute. This patch fixes this.

Also, refactors the JXTemplateGeneratorTestCase

  
I was also going to update jx:attribute to support namespaces and 
prefixes, but when I added the namespace to 
AttributeAwareXMLConsumer.attribute I got no namespace. I tracked the 
namespace and it was going through the system. Not too sure if this is a 
bug or a feature of AttributeAwareXMLConsumer, may investigate further, 
but it isn't a high priority for me.


jx:attribute

2005-10-29 Thread Leszek Gawron

Right now we have:
elem
  jx:attribute name=foo value=bar/
/elem

I would like to implement following syntax:

elem
  jx:attribute name=foobar/jx:attribute
/elem

This would allow to nest jx:* tags in jx:template:
elem
  jx:attribute name=foojx:formatDate
 value=${mydate}//jx:attribute
/elem

I am not quite sure how to reuse text serializer logic to serialize 
contents of jx:attribute node to string. Could anybody help? Assume I 
have a chain of SAX events and access to service manager.


--
Leszek Gawron  [EMAIL PROTECTED]
IT Manager MobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


jx:attribute

2005-04-19 Thread Leszek Gawron
I have committed first (really lame) implementation of jx:attribute.
Finally you are able to do something like:
?xml version=1.0?
root xmlns:jx=http://apache.org/cocoon/templates/jx/1.0;
one
jx:attribute name=foo value=bar/
/one
jx:set var=a value=dd/
two
jx:if test=${a == 'dd'}
jx:attribute name=second value=twoAttr/
/jx:if xyz /two
three foo=bar
jx:attribute name=foo2 value=bar2/
jx:attribute name=${a} value=${a}/
abcdef/abc
/three
/root
Could anyone could review the implementation? It is not NS aware yet.
--
Leszek Gawron MobileBox
[EMAIL PROTECTED]  http://www.mobilebox.pl


Re: jx:attribute

2004-12-03 Thread Jorg Heymans
[EMAIL PROTECTED] wrote:
Maybe this is too simple but what if you iterate over the bean properties
and generate your own xml version with tags, which is then transformed by an
XSL sheet to what you want?
jx:foreach item ...whatever
 mytag${item}/mytag
/jx:foreach
The problem is not so simple but yes XSLT seems like another possible 
solution. I'm a bit worried about the performance impact though because 
my bean (it's an XMLBean acutally) can get quite big, over 8MB and more.

Thanks!
Jorg


Re: jx:attribute

2004-12-03 Thread Leszek Gawron
Jorg Heymans wrote:
[EMAIL PROTECTED] wrote:
Maybe this is too simple but what if you iterate over the bean properties
and generate your own xml version with tags, which is then transformed 
by an
XSL sheet to what you want?

jx:foreach item ...whatever
 mytag${item}/mytag
/jx:foreach

The problem is not so simple but yes XSLT seems like another possible 
solution. I'm a bit worried about the performance impact though because 
my bean (it's an XMLBean acutally) can get quite big, over 8MB and more.

Thanks!
Jorg
Have you tried using Castor ?
--
Leszek Gawron  [EMAIL PROTECTED]
Project ManagerMobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


Re: jx:attribute

2004-12-03 Thread Jorg Heymans

Leszek Gawron wrote:
Jorg Heymans wrote:
[EMAIL PROTECTED] wrote:
Maybe this is too simple but what if you iterate over the bean 
properties
and generate your own xml version with tags, which is then 
transformed by an
XSL sheet to what you want?

jx:foreach item ...whatever
 mytag${item}/mytag
/jx:foreach

The problem is not so simple but yes XSLT seems like another possible 
solution. I'm a bit worried about the performance impact though 
because my bean (it's an XMLBean acutally) can get quite big, over 8MB 
and more.

Thanks!
Jorg
Have you tried using Castor ?
You mean replace the XMLBeans implementation with a castor based one? I 
don't see how this would solve my initial problem though, is there some 
castor specific functionality you had in mind? (i've never used Castor)

Thanks
Jorg


Re: jx:attribute

2004-12-03 Thread Leszek Gawron
Jorg Heymans wrote:
Have you tried using Castor ?

You mean replace the XMLBeans implementation with a castor based one? I 
don't see how this would solve my initial problem though, is there some 
castor specific functionality you had in mind? (i've never used Castor)
Me too but my understanding is that Castor is able to map any bean to 
XML (based on a mapping configuration file).

--
Leszek Gawron  [EMAIL PROTECTED]
Project ManagerMobileBox sp. z o.o.
+48 (61) 855 06 67  http://www.mobilebox.pl
mobile: +48 (501) 720 812   fax: +48 (61) 853 29 65


Re: jx:attribute

2004-12-03 Thread Rogier Peters
Quote Leszek Gawron [EMAIL PROTECTED]:

 Jorg Heymans wrote:
  Have you tried using Castor ?
 
 
  You mean replace the XMLBeans implementation with a castor based one? I
  don't see how this would solve my initial problem though, is there some
  castor specific functionality you had in mind? (i've never used Castor)
 Me too but my understanding is that Castor is able to map any bean to
 XML (based on a mapping configuration file).

There's a castor transformer in the scratchpad. What it does is either
marshalling a bean to an xml-fragment in your pipeline, or unmarshalling by
taking sax-events and creating a bean from that. I only needed the unmarshalling
part, and it was really buggy, but I suspect that's because only the marshalling
was tested. Don't know for sure though, it's scratchpad after all ;). The
mapping file is reasonably simple, and it should also work without a mapping,
especially for marshalling.

I don't know zip about XMLBeans. From the name I would assume it is possible to
use the custom transformer approach the way CastorTransformer does.

Rogier


jx:attribute

2004-12-02 Thread Jorg Heymans
Hi,
A while ago [1], there were talks about getting jx:attribute 
implemented. Has anything come out of this?

I have a usecase where i need to write out an arbitrary list of 
attributes for a tag. Even though these attributes are Nodes i don't see 
any way of doing this in jx without something similar to xsl:attribute.

Or am i missing something here?
Regards
Jorg
[1] http://marc.theaimsgroup.com/?l=xml-cocoon-devm=108222422407397w=2


Re: jx:attribute

2004-12-02 Thread Jorg Heymans
I see, so I will have to abandon my jx generator solution then. Is there 
another generator that can grab a bean from the (session)context and 
generate tags from it?

Can the XSP or JSP generator do this ?
Thanks
Jorg
Leszek Gawron wrote:
Jorg Heymans wrote:
Hi,
A while ago [1], there were talks about getting jx:attribute 
implemented. Has anything come out of this?

I have a usecase where i need to write out an arbitrary list of 
attributes for a tag. Even though these attributes are Nodes i don't 
see any way of doing this in jx without something similar to 
xsl:attribute.

Or am i missing something here?
Nothing happened. The feature was considered very hard to implement.



RE: jx:attribute

2004-12-02 Thread H . vanderLinden
Maybe this is too simple but what if you iterate over the bean properties
and generate your own xml version with tags, which is then transformed by an
XSL sheet to what you want?

jx:foreach item ...whatever
 mytag${item}/mytag
/jx:foreach

HTH.

Bye, Helma

 -Original Message-
 From: Jorg Heymans [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, 02 December 2004 16:41
 To: [EMAIL PROTECTED]
 Subject: Re: jx:attribute
 
 
 I see, so I will have to abandon my jx generator solution 
 then. Is there 
 another generator that can grab a bean from the (session)context and 
 generate tags from it?
 
 Can the XSP or JSP generator do this ?
 
 Thanks
 Jorg
 
 Leszek Gawron wrote:
  Jorg Heymans wrote:
  
  Hi,
 
  A while ago [1], there were talks about getting jx:attribute 
  implemented. Has anything come out of this?
 
  I have a usecase where i need to write out an arbitrary list of 
  attributes for a tag. Even though these attributes are 
 Nodes i don't 
  see any way of doing this in jx without something similar to 
  xsl:attribute.
 
  Or am i missing something here?
  
  Nothing happened. The feature was considered very hard to implement.
 


Re: JXTG jx:attribute

2004-04-25 Thread Leszek Gawron
On Sat, Apr 24, 2004 at 04:51:35PM -0700, Christopher Oliver wrote:
 Leszek Gawron wrote:
 
 Sorry to bother you privately but I did not get the answer on cocoon group 
 and
 I see you're the main JXTG developer.
 
 My question is: Is there any real reason that jx:attribute is not 
 implemented?
 Something that would work as xsl:attribute or xsp:attribute to allow
 generation of dynamic content of an attribute?
  lg
 
  
 
 Please direct all questions to the dev list. The only reason is that it 
 seems hard to implement it efficiently. Consider:
 
 foo
  jx:attribute name=bar namespace=http://www.bar.org; value=${bar}/
  jx:if test={$fubaz  1}
   jx:attribute name=xyz value=100/
   /jx:if
   jx:forEach var=item items=${items}/
   jx:attribute name=${item.name} value=${item.value}/
   /jx:forEach
   ...
 /foo
 
 The start element event for foo must be buffered until all potential 
 jx:attribute tags have been processed. Since these are within 
 conditional blocks and loops determining when that is the case in an 
 efficient way isn't easy.
It looks like you have to buffer foo until you reach another startElement or
get a endElement for /foo.Am I missing sth?
lg
-- 
__
 | /  \ |Leszek Gawron//  \\
\_\\  //_/   [EMAIL PROTECTED]   _\\()//_
 .'/()\'. Phone: +48(501)720812 / //  \\ \
  \\  //  recursive: adj; see recursive  | \__/ |



Re: JXTG jx:attribute

2004-04-25 Thread Leszek Gawron
On Sat, Apr 24, 2004 at 04:51:35PM -0700, Christopher Oliver wrote:
 Leszek Gawron wrote:
 
 Sorry to bother you privately but I did not get the answer on cocoon group 
 and
 I see you're the main JXTG developer.
 
 My question is: Is there any real reason that jx:attribute is not 
 implemented?
 Something that would work as xsl:attribute or xsp:attribute to allow
 generation of dynamic content of an attribute?
  lg
 
  
 
 Please direct all questions to the dev list. The only reason is that it 
 seems hard to implement it efficiently. Consider:
 
 foo
  jx:attribute name=bar namespace=http://www.bar.org; value=${bar}/
  jx:if test={$fubaz  1}
   jx:attribute name=xyz value=100/
   /jx:if
   jx:forEach var=item items=${items}/
   jx:attribute name=${item.name} value=${item.value}/
   /jx:forEach
   ...
 /foo
 
 The start element event for foo must be buffered until all potential 
 jx:attribute tags have been processed. Since these are within 
 conditional blocks and loops determining when that is the case in an 
 efficient way isn't easy
After a longer thinking it really does not look so easy. As it is not known if
an element has dynamic attributes or not the start element on the output would
have to be postponed for EVERY elemeny till we reach startElement for a child
node a endElement for current one.

Still I do not see any efficiency issuses here: only one element has to be
cached so it does not impart neither speed nor memory requirements.
lg

-- 
__
 | /  \ |Leszek Gawron//  \\
\_\\  //_/   [EMAIL PROTECTED]   _\\()//_
 .'/()\'. Phone: +48(501)720812 / //  \\ \
  \\  //  recursive: adj; see recursive  | \__/ |



RE: JXTG jx:attribute

2004-04-25 Thread Conal Tuohy
 On Sat, Apr 24, 2004 at 04:51:35PM -0700, Christopher Oliver wrote:

  foo
   jx:attribute name=bar namespace=http://www.bar.org; 
 value=${bar}/
   jx:if test={$fubaz  1}
jx:attribute name=xyz value=100/
/jx:if
jx:forEach var=item items=${items}/
jx:attribute name=${item.name} value=${item.value}/
/jx:forEach
...
  /foo
  
  The start element event for foo must be buffered until 
 all potential 
  jx:attribute tags have been processed. Since these are within 
  conditional blocks and loops determining when that is the 
 case in an 
  efficient way isn't easy

Leszek Gawron wrote:

 After a longer thinking it really does not look so easy. As 
 it is not known if
 an element has dynamic attributes or not the start element on 
 the output would
 have to be postponed for EVERY elemeny till we reach 
 startElement for a child
 node a endElement for current one.

... or a characters() event containing non-whitespace.
Whitespace characters() between an element an jx:attribute should not be output at all.


Re: JXTG jx:attribute

2004-04-24 Thread Christopher Oliver
Leszek Gawron wrote:

Sorry to bother you privately but I did not get the answer on cocoon group and
I see you're the main JXTG developer.
My question is: Is there any real reason that jx:attribute is not implemented?
Something that would work as xsl:attribute or xsp:attribute to allow
generation of dynamic content of an attribute?
lg
 

Please direct all questions to the dev list. The only reason is that it 
seems hard to implement it efficiently. Consider:

foo
 jx:attribute name=bar namespace=http://www.bar.org; value=${bar}/
 jx:if test={$fubaz  1}
  jx:attribute name=xyz value=100/
  /jx:if
  jx:forEach var=item items=${items}/
  jx:attribute name=${item.name} value=${item.value}/
  /jx:forEach
  ...
/foo
The start element event for foo must be buffered until all potential 
jx:attribute tags have been processed. Since these are within 
conditional blocks and loops determining when that is the case in an 
efficient way isn't easy.

Chris