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

Please help: Transforming a node and retrieving siblin

Subject: Please help: Transforming a node and retrieving siblings + ancestors
From: "s s" <ss_theone@xxxxxxxxxxx>
Date: Thu, 11 Jul 2002 21:37:00 +0000
siblin
Hello,

I am using Java and Xalan-J 2 xslt engine. I would like to know I could do this:

Let's say I have the following xml:
 <?xml version="1.0" ?>
 <root prop="try to get this">
  <childone>or try get this text</childone>
  <childtwo><childtwoone>test text</childtwoone></childtwo>
  <childthree></childthree>
 </root>
--

And let's also assume that we've got this in DOM model object with childtwooneNode representing the 'childtwoone' tag and rootNode representing the 'root' element:

Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource("c:\\temp\\somexslfile.xsl"));
transformer.transform(new DOMSource(childtwooneNode), new StreamResult(System.out));
--


Now in my xsl file how do I go about retrieving text from the 'childone' tag or the root's attribute 'prop'.

I was able to do this using Microsoft XML 3 parsers just fine by using the following for example:
<xsl:value-of select="../childone" />
--


The reason childtwoone node needs to be fed into the transformation is b/c it's the node that most of the data comes from, but there are (smaller yet some!) pieces of information that come from the rest of the document.

I would really really be greatful if someone could tell me how I could get this working. An example would be great!


Thanks for the help in advance, Sean S.

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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.