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

RE: Returning a document fragment from Xalan extension

Subject: RE: Returning a document fragment from Xalan extension function
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Tue, 10 Jun 2003 12:36:51 -0700
xalan create fragment
Hi,

A simpler way to handle this might be to create a URIResolver (check google)
and return the string (new StreamSource(new StringReader(str))) to a
document("my_string_identifier") function call. This will give you what you
want. Then you won't have to deal with extensions and converting your string
to a Node.

Best,
-Rob

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-
> list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Michal Urban
> Sent: Tuesday, June 10, 2003 12:08 PM
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> 
> Hello all, this is my first posting regarding my very first Xalan
> extension
> function in Java, I'll appreciate your thoughts:
> 
> I'm processing the text() nodes and possibly adding markup to plain text
> (via external calls to "sed" - I have a set of rather tricky rules
> to perform ;-).
> 
> When I return the result as a String, any inline "<elem>" gets translated
> into "&lt;elem&gt;" in the output. I can understand this since that's how
> a
> String should probably behave...
> 
> When I create a DOM Document out of the text result and return it as a
> Node
> or DocumentFragment, any added markup is lost and only concatenated text()
> content from the result tree gets into the Xalan output.
> 
> What is the proper way of passing the entire "enriched" structure into the
> output?
> 
> I can actually get by using the "String" method with an additional "sed"
> pass of the output file replacing "&lt;" etc. with proper markup, but
> that's
> certainly a crude way of doing it...
> 
> Can anybody think about a better way of doing this (instead of
> Xalan-XSLT/Java/sed "contraption"). I looked into XSLT 2.0 (Saxon 7) and
> EXSLT but I don't think plain regexp match/replace will cut it here - sed
> scripts are more powerful/convenient (especially the external and XSL
> independent config - based on XSLT params or data).
> 
> Thank you,
> 
> Michal Urban
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.