At 99/04/05 15:28 +0100, Ben Jung wrote: >I am having problems to extract
element-names from XML documents with XSL >stylesheets: > >Assuming, I have
the
following XML fragment: >--------------- > > Ben > 5 > Ireland >
>--------------- > >Next: I want to create the following 'table':
>--------------- >Name: Ben >Age: 5 >Country: Ireland >--------------- You
don't mention if you are using W3C-XSL or MS-XSL, so I've included below an
example of both: person.xsl = W3C-XSL person.msxsl = Microsoft XSL I've needed
to do this myself in one of my text-based outputs. In each stylesheet you can
see each implementation's access to the name of the current node. I hope this
helps. .......... Ken T:\FTEMP>type person.xml Ben 5 Ireland T:\FTEMP>type
person.xsl : T:\FTEMP>call xsl person.xml person.xsl
person.htm T:\FTEMP>type person.htm Name: Ben
Age: 5
Country: Ireland
T:\FTEMP>type person.msxsl this.nodeName: T:\FTEMP>call
msxsl person.xml person.msxsl person.mshtm T:\FTEMP>type person.mshtm Name:
Ben
Age: 5
Country: Ireland
T:\FTEMP>
--
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (Fax:-0995)
Website: XSL/XML/DSSSL/SGML services outline, XSL/DSSSL shareware,
stylesheet resource library, conference training schedule,
commercial stylesheet training materials, on-line XSL CBT.
Next instructor-led XSL Training: WWW8:1999-05-11
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|