Project

Profile

Help

Extension Instructions for HTML Component Lib

Added by Anonymous almost 15 years ago

Legacy ID: #7950191 Legacy Poster: Matt (mraccola)

I work on an application that uses XSLT to render the HTML representation of the user interface. We would like to build a component library for our framework, something along the lines of the core Flex or JSF components. It seems that the way to do this would be to write custom extension instructions, [http://saxonica.com/documentation/extensibility/instructions.html][1]. I tried prototyping a simple panel component that will generate a fancy DIV around arbitrary HTML content. Sample markup would look like this: <custom:panel ...>

...
</custom:panel> I am running into multiple issues especially when I try to process the child content. The sample SQL extension instructions don't really have true children so they aren't sufficient for me to use as a basis for architecting the solution. I tried Googling different search terms trying to see if anyone had done this before and didn't really get many hits. Overall the programming model doesn't appear to be designed for extension. It seems you would need to know a great deal about the inner workings of Saxon to make progress. Here is the latest error I am hitting on while trying to declare variables within the custom panel tag. This will give you an idea of the types of issues I am running into. In order for me to troubleshoot this I will have to go it and read through some Saxon code to figure out what is going on. java.lang.AssertionError: Internal error: invalid slot number for local variable (0) at net.sf.saxon.expr.XPathContextMinor.setLocalVariable(XPathContextMinor.java:362) at net.sf.saxon.instruct.LocalVariable.processLeavingTail(LocalVariable.java:20) at net.sf.saxon.instruct.Instruction.process(Instruction.java:93) at fleetcycle.ui.xslcomponents.Panel$PanelInstruction.process(Panel.java:117) Can you please comment on the feasibility of this project I am undertaking? If there are alternatives that I am not thinking of that would be helpful to know as well. [1]: http://saxonica.com/documentation/extensibility/instructions.html

Replies (1)

RE: Extension Instructions for HTML Component Lib - Added by Anonymous almost 15 years ago

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

Your analysis is basically correct. The interface for writing extension instructions is low-level, poorly documented, and lacks robustness. In fact, it's not really an API in any meaningful sense of the word; you pretty well have to write your code as if it were part of the Saxon internals. I would like to do a cleaner API, along the lines of the new interface introduced in 9.2 for writing integrated extension functions; but it's not really very high on the agenda, given that not many people are trying to write such extensions.

    (1-1/1)

    Please register to reply