Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2012, 04:53 PM
Registered User
 
Join Date: Aug 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default reading the node name using XPATH and XSLT

input XML File.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://kkkk/2.0/" xmlns:ns1="http://pppp/1.0/" xmlns:ns2="http://mmm/1.0/">
<soapenv:Header/>
<soapenv:Body>
<ns1:authenticateUserRequest>
<ns2:username>kkk</ns2:username>
<ns2:password>SSJKKKKKDI</ns2:password>
</ns1:authenticateUserRequest>
</soapenv:Body>
</soapenv:Envelope>

I need to extract the name of element(node) name immediate to <soapenv:Body>
in above given xml file.

for Example "authenticateUserRequest"
 
Old March 2nd, 2012, 06:07 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Code:
local-name(//soapEnv:body/*[1])
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT/XPath: How to display single node occurence kwilliams XSLT 3 March 17th, 2009 10:42 AM
XPath to get next node (sibling) jeft0nes XSLT 2 August 8th, 2007 08:30 PM
XPath node selection nkuar XML 1 March 4th, 2006 09:40 PM
Read xpath query from node value jaquing XSLT 2 January 11th, 2006 06:50 PM
Access Namespace Node using XPath pvasudevan XSLT 1 January 2nd, 2006 06:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.