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

Re: FOP & Extensions

Subject: Re: FOP & Extensions
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Thu, 27 Jan 2011 19:30:40 +0100
Re:  FOP & Extensions
CRANFORD, CHRIS wrote:
I have an XML document that contains XPATH references like the
following:

<ROOT>
   <DATAID>1</DATAID>
   <DATAS>
     <DATA>
       <ID>1</ID>
       <TYPE>Type1</TYPE>
     </DATA>
     <DATA>
       <ID>2</ID>
       <TYPE>Type2</TYPE>
     </DATA>
   </DATAS>
   <DATA reference="/ROOT/DATAS/DATA[1]/ID" />
</ROOT>

In my XSLT, I need to be able to acquire the /ROOT/DATA/@reference
string and then using some type of evaluation extension, I need to be
able to obtain the value pointed to by the XPATH of this attribute.
Therefore, the select result would yield '1'.

I've read I could use XALAN-J or EXSLT; however I am unclear how to:

1. Install these extensions in my web application
2. Reference them for use in my XSLT.

Can someone give me a quick and dirty step-by-step of how to do this?

Saxon is an XSLT 2.0 processor implemented in Java so you can use that instead of Xalan-J.
In its commercial versions (or in the 9.1 release) it has an extension function
http://www.saxonica.com/documentation/extensions/functions/evaluate-node.xml
you can use e.g.


  <xsl:template match="/ROOT/DATA">
    <xsl:variable name="ref" select="saxon:evaluate-node(@reference)"
      xmlns:saxon="http://saxon.sf.net/"/>
  </xsl:template>


--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

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.