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

Re: Return structured java Object (e.g. List) to XSLT

Subject: Re: Return structured java Object (e.g. List) to XSLT for further processing
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Dec 2014 11:16:04 -0000
Re:  Return structured java Object (e.g. List) to XSLT
This question is very Saxon-specific. In future, I would suggest using a
Saxon-specific forum, e.g. saxonica.plan.io.


>
> public Object footnote(Object nr, Object html) {  }
>
> I can cast the nr (which is //footnote/@nr) and html (which is
//footnote/*) to SequenceExtent.

You can't rely on them being supplied as instances of SequenceExtent. For
example, if the value is a singleton or an empty sequence (or in future
releases) a different class might be used.

Better to declare the argument types as net.sf.saxon.om.Sequence, and make no
assumptions beyond them being a Sequence.

>
> Now I can process the footnotes.
>
> As result I want to return the processed footnotes, so that they can be
processed by xsl as an result tree fragment.
>
>
Rather depends how you are constructing them. It might be easiest to use a
tree model that's designed for manipulation in Java, e.g. JDOM2, and then
return a JDOM2 DocumentWrapper. If you want to construct a Saxon tree, you can
instantiate a Builder and then feed it startElement() and endElement() events,
but that's not especially convenient. Ultimately, though, you want to return
an instance of the class DocumentInfo.

Michael Kay
Saxonica

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.