This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Please help: Transforming a node and retrieving siblings + ancestors
- From: "s s" <ss_theone at hotmail dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 11 Jul 2002 21:37:00 +0000
- Subject: [xsl] Please help: Transforming a node and retrieving siblings + ancestors
- Reply-to: xsl-list at lists dot mulberrytech dot com
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