[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Setting variable to namespace prefix
Apologies in advance for what's certainly a rookie question, but I guess I've got to start somewhere. I'm trying to assign an xsl:variable to the value of the namespace prefix for current context (using <oXygen/> with Saxon6.5.5) For example, I have the XML fragment: <xsd:schema xmlns:common="http://[url]" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://[url]" elementFormDefault="qualified"> <xsd:complexType name="name"/> </xsd:schema> Where [url] is the same value in both cases. I would expect the following to set the ns-prefix variable to "common" <xsl:variable name="ns-prefix"> <xsl:for-each select="namespace::node()"> <xsl:if test="(.)=(../../@targetNamespage)"> <xsl:value-of select="name(.)"/> </xsl:if> </xsl:for-each> </xsl:variable> I can step through the transformation in <oXygen/> and verify that the test is true and name(.) contains the value "common", but (probably for some really dumb reason that I'm just missing) the variable isn't being set. Help is appreciated. TIA, Stephen P.S. Extra apologies if the answer to this question is in the FAQ or the archives. I suspect it is, but I'm just not recognizing it.
|
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
|