[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

question regarding Saxon customized extension and Node

Subject: question regarding Saxon customized extension and NodeInfo
From: "Yang, Yue [IT]" <yue.yang@xxxxxxxx>
Date: Thu, 21 Mar 2002 12:26:19 -0500
saxon create nodeinfo
hi,
I am trying to write a customized Saxon java extension which reads a file,
convert each line into a Node and put into a NodeSet, then have stylesheet
process the NodeSet.

While working with Saxon, first of all, I am quite very amazed by its speed,
efficiency and intuitive implementation, kudo and thanks to Mr. Kay!....
anyway, my question, in my code i have:

while(null!=(value=br.readLine()))
{
	builder.startElement(eName, emptyAtts, namespaces, 1);

	builder.characters(value.toCharArray(), 0, value.length());

	builder.endElement(eName);
}

where br is the BufferedReader.  Here I actually process the input twice,
once to read each line from the file and convert it into element in builder,
then once more in the stylesheet which iterates thru the NodeEnumeration.

What I wanted is to process it just once... so I created a customized class
that implements NodeEnumeration interface... so each call to nextElement()
actually calls the BuffereReader.readLine() until readLine() returns null...
I have everything in place, except I couldn't figure out how to create an
NodeInfo (which is required by NodeEnumeration.nextElement()).  Basically I
want to get the one line of text from the file, and somehow convert it into
a NodeInfo.... 

so, if the text reads: "blahblahblahblahblahblah", then it would become
"<line>blahblahblahblahblahblah</line>".  Like in JDOM, you can create an
Element, and in Xalan, you have createTextNode(string)... etc...

hope this is not too confusing... appreciate it if anyone can help.

thanks again!!!


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.