473,659 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with TransformerHand ler and Lexical events

Hello!

I have set up a pluggable SAX transformation pipeline which is made up
of individual nodes that transform the source XML, and for the most part
it works well. Each node in the pipeline is assigned a ContentHandler
and a LexicalHandler by the transformation framework.

Each node in the pipeline may either be:

* a class that implements ContentHandler and LexicalHandler
* a wrapper class that creates a TransformerHand ler from an XSL
stylesheet and handles the SAX events.

The first case works perfectly. Both normal and lexical SAX events are
processed and then reported to the following nodes in the pipeline.

I'm having trouble with the second case; specifically lexical events
such as comments are not being passed to the next node.

Each node defines a setOutputHandle rs() (below) that sets the handlers
for events generated by that node. For the xslt wrapper, I simply
create a SAXResult using both the ContentHandler and the LexicalHandler
and then proceed to create the TransformerHand ler member that will
receive SAX events from the previous node.

Is there something I am doing wrong here that would prevent my xsl
stylesheet from passing the lexical events to the next node? I have
already verified that the transformation correctly passes through
comments in XMLSpy and that my framework is correctly invoking
transformerHand ler.comment() when a comment event fires on a previous node.

Thanks for any help, thoughts, or suggestions.

Collin

p.s. I forgot to crosspost this from comp.lang.java. programmer -- Sorry
for the duplicates :(

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

public void setOutputHandle rs(ContentHandl er content, LexicalHandler
lexical) throws SAXException
{
super.setOutput Handlers(conten t, lexical);
this.result = new SAXResult();
this.result.set Handler(content );
this.result.set LexicalHandler( lexical);

try
{
final String xslt = fetchXSLTAsStri ng();
final SAXSource xsltSource = new SAXSource(new
InputSource(new BufferedReader( new StringReader(xs lt))));
final SAXTransformerF actory factory =
(SAXTransformer Factory) TransformerFact ory.newInstance ();
this.transforme rHandler =
factory.newTran sformerHandler( xsltSource);
this.transforme rHandler.setRes ult(this.result );
}
catch (Exception e)
{
throw new SAXException(e) ;
}
}
Jul 20 '05 #1
0 1452

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
3039
by: Konrad Den Ende | last post by:
Normally, one can put any bull as long as comments are on, as in: // import yava.biteme.yo_mamma; but when i tried to do //String s = "\u305\u3048"; the stupid computer tells me to shut up by claiming that it's an illegal unicode escape. Now, i've bought it, so i'll tell it what is
3
2302
by: Matt Knepley | last post by:
I must be misunderstanding how Python 2.3 handles lexical scoping. Here is a sample piece of code: def run(): a = 1 def run2(b): print a run2(2) print a run()
4
4395
by: bariole | last post by:
Hi I am trying to make lexical analysis of some simplified html code with flex tool. However that kind of work is new to me and I don't know where to start. I have searched a web but I didn't find anything useful. I found tools like LEXHTML.CXX library but I have no need for that. What I need is simple overview of working ideas of most usual html lexical analysators like ones inside IE or Gecko. Something like good
13
1943
by: Lucas Zimmerman | last post by:
Is there any Lex code available that describes how to scan C programs? I'd like to read someting related to this. One of my doubs is how C deals with ambiguities, for example, `a = x/*p;' or `a = x//*...*/-3;' (considering c99's `//'). thanks in advance, n.
18
1789
by: jslowery | last post by:
I am not completely knowledgable about the status of lexical scoping in Python, but it was my understanding that this was added in a long time ago around python2.1-python2.2 I am using python2.4 and the following code throws a "status variable" not found in the inner-most function, even when I try to "global" it. def collect(fields, reducer): def rule(record): status = True
2
2322
by: Frank-René Schäfer | last post by:
penSource Project 'Quex': http://quex.sf.net Last weekend, the lexical analyser generator 'Quex' has been released on SourceForge. Quex provides advanced features for mode definitions and event handling. Among its features are -- Creation of a complete C++ environment for lexical analyser engines. -- Modes management:
14
2171
by: Khookie | last post by:
Woah... is it just me or do C programmers don't bother talking about how cool C can be (compared to Lisp, Haskell, etc.) - functionally speaking? // Lexical scoping - via nested functions #include <stdio.h> int main() { int x = 10;
3
8789
by: globalrev | last post by:
i cant figure outif python has lexical or general scope. it seems functions have lexical scope but with some restrictions and some non-function scopes are dynamic?
3
2189
by: =?Utf-8?B?TWFya19C?= | last post by:
The following is working for me but I want to include numbers in scientific notation. public double Evaluate( string expr ) { const string Num = @"(\-?\d+\.?\d*|\-?\.\d+)" Regex reMulDiv = new Regex(Num + @"\s*()\s*" + Num); other stuff:
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.