Project

Profile

Help

Help with Java code generation XSL

Added by Anonymous about 14 years ago

Legacy ID: #8304700 Legacy Poster: mcnoche (mcnoche)

Hello...I have a project which uses XSL to generate Java code from some XML. I am having issues generating some constants from an element where the explicit value is not provided and should be assumed to be the value from the previously defined enum. For example, the following XML demonstrates this: The "NO_CHANGE" value should be 0x03 or BLINK + 1. The specific issue I am having is "storing" the last value or named enum so that when I run across an element without an "explicit" attribute I use the last saved enum + 1. I am struggling with this as I want to just save the last known good enumeration but have not found a way to do this. Can anyone point me in the right direction here? Thanks!


Replies (1)

RE: Help with Java code generation XSL - Added by Anonymous about 14 years ago

Legacy ID: #8304745 Legacy Poster: Michael Kay (mhkay)

XSLT programming advice is best sought on the xsl-list at mulberrytech.com - this list is for issues specific to the Saxon product. You're thinking about the problem far too procedurally: you don't "store" or "save" values in XSLT for later use. Instead, use a rule that calculates the value you need as a function of the original input. It's difficult to be more precise as you don't say what output you are looking for, or what your current code looks like.

    (1-1/1)

    Please register to reply