xsl-list
[Top] [All Lists]

[xsl] XPath questions: selecting from an attribute node axis and an attribute name variable

2011-09-30 18:48:06
Hi,
I am using XSLT 2.0. and have two questions I have been unable to resolve:

(1) An attribute name variable:
Is it possible to write
   <xsl:for-each select="../Stamp/Formats/@souvenir-sheet">
in such a way that @souvenir-sheet is replaced by a variable representing other attributes so that the same statement could be used to service a different specific <Formats> attribute? i.e, xsl:for-each select="../Stamp/Formats/@minisheet"> "Any" will not work, the name has to be specific.

(2) Selecting from the attribute axis:
From within the context provided by the execution of
   xsl:for-each select="../Stamp/Formats/@souvenir-sheet">
in the <Stamp> element below , is it possible to select the element <CatNumber>'s attribute: pofis-number?
i.e.,
<xsl:variable name="file-name" select="concat([some XPath expression?]CatNumbers/@pofis-number, '.htm')"/>

XML fragment
<Stamp>
     <CatNumbers scott-number="3040" scott-suffix="a" pofis-number="174"/>
      <Formats souvenir-sheet="174"/>
</Stamp>

I really hope the answers are yes and that you can tell me how. I tried to find this info in Michael's book, but failed.

Thanks,

Mark








--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>