It's one of many reasons that XSplit will always be my software of choice to go live. Transition your physical event presence to a digital one and increase your viewership. Take your job interviews or professional calls to the next level. Video tools built with your business ideas passion knowledge product content stories gameplay in mind Get Started Now.
Learn More Get Started Now. There are several things to note about these two files. First, note that we inform the XSP processor that it should apply our custom logicsheet using the processing instruction:. There are other ways to associate a logicsheet with an XSP file, which we'll discuss later. Next, note that our logicsheet defines a new namespace, greeting: , which must be declared in both files using the same URI:.
Note that the logicsheet URI is completely arbitrary. Finally, note that our logicsheet is merely an XSL stylesheet. It transforms one XML file into another. What makes it a logicsheet is that it can be applied not just to any XML file, but specifically to an XSP file, and the end result of its transformation is another XSP file.
If you were to apply the logicsheet in this example to the XML file in this example as just a stylesheet with no XSP processing , you would end up with something like the following compare to our earlier XSP example :. There are two ways to apply a logicsheet, once you have written it. There is another way to apply a logicsheet, which doesn't require a processing instruction for each file that uses the logicsheet.
The second way is to declare logicsheet in the cocoon. These declarations take the form. Cocoon's pre-defined logicsheets are already declared in this file. For instance, the declaration of the XSP request taglib is the following:. This URL points to a file that is stored in the cocoon. To use the request taglib, you must declare the request namespace in your XSP file:.
You can add your own logicsheets to the cocoon. The only trick is constructing an appropriate URL. If we wanted to declare our greeting: namespace and logicsheet from the Hello, World!
In addition to using 'file:' protocol, logicsheet URL can use 'resource:' protocol to load logicsheets from the class loader, or 'context:' protocol to specify URL relative to the web application context directory. There are some very important differences between using the 'resource:' protocol vs. Using 'resource:', any time the logicsheet changes, it is necessary to restart Cocoon.
If you instead use the 'file:' or 'context:', and you are not deploying Cocoon as a single war file , Cocoon will detect modifications to your logicsheet, and recompile your XSP programs accordingly.
If you happen to need to explicitly control the order in which your logicsheets are applied, you need to use the processing instruction. Logicsheets will be applied in the order in which they appear in processing instructions in your source file. Whichever method you use, the most important thing to remember is that you must declare, in your XSP program, the namespace for a logicsheet using the same URI as in the logicsheet itself. A bad assumption in any of these areas can lead to an hour of debugging.
Following a few simple practices can reduce the frustration and make logicsheet programming less difficult:. Since we are always expecting to act on an XSP source file, and there is the possibility that other logicsheets may also be acting on the same file either before or after our logicsheet , there are a few templates which are more or less required in any logicsheet.
The templates below were all pulled from the taglib logicsheets distributed with Cocoon. The first of these is simply a template to copy anything you don't directly act upon yourself. You probably have a template similar to this in most of your stylesheets already. Here is a template to let you do that from esql. Frequently, you may also need to declare variables or perform initialization that needs to occur before any of the code in your custom tags.
You could, of course, require that the users of your logicsheet use one particular tag before using any other, and then put your declarations and initializations in the template matching that one tag. This may not be the best solution, however, and may be a source of confusion.
Instead, the following template can be used to insert code inside the populateDocument method, after the standard XSP code such as declaration of the request and response variables , but before any user code from the source XSP file including code inserted by your custom tags.
Since software tends to build on other software, you will probably find yourself wanting to write logicsheets which make use of other logicsheets, particularly the logicsheets provided with Cocoon. This is very possible. When using one logicsheet inside another, the most important thing to remember is that you must declare the namespace for the second logicsheet not only in the first logicsheet, but also in any XSP program that uses the first logicsheet, even if it doesn't directly reference any of the tags in the second logicsheet.
Errors and Improvements? If you see any errors or potential improvements in this document please help us: View, Edit or comment on the latest development version registration required. You can find that here.
I also recommend that you consider using Royalty Free Stock images and art, find that on the Graphics and Stock Images page. XSitePro 2. It may help take you to the next level with XSitePro. If you need further help, feel free to contact me. XSite Pro2.
XSitePro25 Registration Code re-send - just in case you might have lost your registration code you can have it sent to you again from this page. Includes a 4 step plan and additional resources time XSP has been designed to support other scripting languages, in addition to Java. In principle, any programming language for which a Java-based interpreter exists could be used to script XSP pages. Interpreted languages, however, are expected to play an important role in XSP scripting. This is so because in addition to their typical ease of use more and more field-specialized languages are being developed for the JVM.
Such specialized scripting languages usually offer more expressive power and conciseness than strictly object-oriented languages. Until recently, Java lacked a well-defined scripting architecture that allowed applications to incorporate scripting easily.
Currently, XSP only supports Java as a scripting language, though its design allows for an easy integration of other languages. In the near future, BSF will be integrated to XSP's own language abstraction mechanism so that most if not all of the above mentioned languages may become available for XSP scripting. XSP tag libraries are language-dependent. Thus, the addition of a new language involves at the very least porting the XSP built-in libraries.
A library's code-generation stylesheet is simply a "regular" XSLT stylesheet responsible for translating user-defined dynamic tags into equivalent XSP tags for a given scripting language sometimes called logicsheet. While a preprocessor is an optional library Java class used to augment an XSP page DOM tree prior to applying the library code-generation stylesheet. Library preprocessors may be language-dependent. Early experience suggests, though, that the same preprocessor class will be typically shared by different languages for the same dynamic tagset.
XSLT extension functions and extension elements may replace library preprocessors in the future. In this case, all code-generation logic would reside in the library's stylesheet. At this early development stage, we still don't know how the implementation will evolve and we look forward for public feedback before going any further along with the implementation details. This initial implementation of XSP has been developed by Exolab and is being donated to the Apache project as part of Exoffice's commitment to the open source movement.
Last, but not least, cheers to Stefano Mazzocchi , founder and leader of the Cocoon project and original author of the XSP specification. XSP Processor. User Guide. Dynamic XML. How it works. XML Links. XSP WD. ESQL Taglib. SQL Conn Pool. FP Taglib. LDAP Processor. SQL Processor. SQL Taglib.
0コメント