|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Please help: Transforming a node and retrieving 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!
_________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








