use-attribute-sets & attribute value template
Added by Anonymous over 19 years ago
Legacy ID: #3263252 Legacy Poster: David Player (dcplayer)
Using Saxon-B 8.3. It seems that when I use an attribute value template to specify the name in an xsl:element construct, Saxon ignores the accompanying use-attribute-sets value. The following code gives an example of the problem. As it stands, the Data element is output, but without the foo attribute. Is anyone experiencing the same behaviour? Thanks for any insight, David. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"> <xsl:attribute-set name="foobar"> <xsl:attribute name="foo">bar</xsl:attribute> </xsl:attribute-set> <xsl:variable name="element_name">Data</xsl:variable> <xsl:template match="/"> <!-- It seems Saxon has a problem with the following line... --> <xsl:element name="{$element_name}" use-attribute-sets="foobar"> <!-- whereas this line will work as expected... --> <!--xsl:element name="Data" use-attribute-sets="foobar" --> <xsl:copy-of select="."/> </xsl:element> </xsl:template> </xsl:stylesheet>
Replies (5)
Please register to reply
RE: use-attribute-sets & attribute value temp - Added by Anonymous over 19 years ago
Legacy ID: #3263259 Legacy Poster: David Player (dcplayer)
Correction - I'm actually using Saxon-B 8.4.
RE: use-attribute-sets & attribute value temp - Added by Anonymous over 19 years ago
Legacy ID: #3263538 Legacy Poster: Michael Kay (mhkay)
Thanks for reporting this. I have logged the bug and provided a source fix at https://sourceforge.net/tracker/index.php?func=detail&aid=1244273&group_id=29872&atid=397617 I suspect this one has been lurking in the code for quite a few releases. Michael Kay
RE: use-attribute-sets & attribute value temp - Added by Anonymous over 19 years ago
Legacy ID: #3264227 Legacy Poster: David Player (dcplayer)
Thank you, Michael, for your quick response to the problem. I'm new to Saxon and to SourceForge - could someone please point me towards some instructions/pre-requisites for compiling Saxon? I've searched the documentation, source package and project pages without any success. Thanks, David.
RE: use-attribute-sets & attribute value temp - Added by Anonymous over 19 years ago
Legacy ID: #3264266 Legacy Poster: Michael Kay (mhkay)
I don't actually publish any scripts or build instructions, mainly on the grounds that if you don't know how to do it then it's probably better not to attempt it. If you have a Java IDE, it's very straightforward anyway: you just load the whole directory structure into the IDE and click "compile all" (though the details vary from one IDE to another, of course).
RE: use-attribute-sets & attribute value temp - Added by Anonymous over 19 years ago
Legacy ID: #3266819 Legacy Poster: David Player (dcplayer)
Michael, Yeap, I did an import into Eclipse already, but immediately got a bunch of missing class errors for what appears to be external packages (e.g. org.jdom, nu.xom). I am a Java programmer, but I don't know the architecture of Saxon and what it requires. I wondered whether I had overlooked a list of external dependencies lurking about somewhere, which would make it straightforward to apply the bug fix and recompile. No problem, though, I'll work through the errors and do some searching for the missing packages until I get a clean compilation. Thanks again for the prompt source fix. David.
Please register to reply