Hi Ryan

Good idea, thanks! I've refactored the XsltComponent to enable property copying by default as you suggest and make it easier to extend to change how either the content-transformation or property copying should occur. Changes in CVS HEAD now.

James

Schweter, Ryan wrote:
Here's what I did to fix it..

XsltComponent:

private boolean copyProperties;

public boolean isCopyProperties() {

      return copyProperties;

}

public void setCopyProperties(boolean copyProperties) {

    this.copyProperties = copyProperties;

}

protected boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws MessagingException {

    try {

        Transformer transformer = createTransformer(exchange, in);

        ...

        out.setContent(new StringSource(xml));

        if (copyProperties) {

for (Iterator iter = in.getPropertyNames().iterator(); iter.hasNext();) {

                String name = (String) iter.next();

Object value = in.getProperty(name);
                out.setProperty(name, value);

            }

        }

        ...

}

------------------------------------------------------------------------

*From:* Schweter, Ryan
*Sent:* Tuesday, August 30, 2005 10:12 PM
*To:* [email protected]
*Subject:* [servicemix-user] XSLT Transforms "Strip" Properties

When one transforms an xml message, the inbound properties are not copied over to the outbound message. If it’s the intent to not do so by default, I think there should be an option to allow for it.

Thoughts?

_____________________________________________________
|\| R Y A N  S C H W E T E R                      |\|
|/|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯                |/|
|\| developer                                      \|
|/| IT Application Delivery
|\| .: 512.742.7875
|/| .: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
|\|
¯¯¯



--

James
-------
http://radio.weblogs.com/0112098/

Reply via email to