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

RE: getting node type in xsl

Subject: RE: getting node type in xsl
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 7 Sep 2004 16:25:09 +0100
node type
> 1) how can I find out about the current node's type defined in the
> data document's xsd schema?

This is very much the stuff of schema-aware XSLT 2.0, which allows you to do
things like

<xsl:if test=". instance of schema-element(my:invoice)">

or

<xsl:template match="element(*, my:invoice-type)">

Give it a try by downloading an evaluation copy of Saxon-SA at
www.saxonica.com.

> 2) how can I give a node a unique id, that I can somehow reuse to
> programmatically alter it's value (some serialization of the absolute
> xPath using something else than the "/" and "[ ]" characters, like
> "ID#animal-1#chicken-3#egg-5" for /animal[1]/chicken[3]/egg[5])?
> generate-id() doesn't do this...

XSLT doesn't allow you to alter the value of a node... There's an extension
function to get a path to a node in Saxon, and there are "pure XSLT"
solutions in the FAQ (somewhere!).

Michael Kay


> 
> and there is a third! Am I reinventing the wheel for the nth time
> here? I tried to google something up, but to no avail...
> 
> cheers and thanks for all the help from this great list!
> 
> 
> -- 
> Jan Limpens
> http://www.limpens.com

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.