[Home] [By Thread] [By Date] [Recent Entries]
At 12:30 PM 7/1/2008, you wrote:
> Actually, as Ken said, to write the attribute value you should use > xsl:value-of. xsl:apply-templates should not work: if it does, your > processor is not being conformant, and your code will break in > another processor. Yes, but if you apply templates when matching an attribute, there are no nodes to apply templates to: <xsl:template match="@*"> <xsl:apply-templates/> </xsl:template> If you apply templates to an attribute, you get its value (by default). <xsl:template match="*"> <xsl:apply-templates select="@*/> </xsl:template> (Maybe this was what was meant, in which case I apologize for confusing things, and thanks for the clarification in any case.) > Sometimes they bend the rules and introduce some > sort of structure into attribute values, but when they do, it's > always simple enough to parse easily (for example tokenized values, > or maybe tokenized values with labels), since this generally has to > be done in the application not by the XML parser. But this isn't something I would wish on a beginner. You have to be both adept at plain-text processing and at composing complex logic in XSLT. BTW, I take it you mean XSLT 2.0, for those regexps w/o extension? I dare say even an expert will put the code into a library so it doesn't have to be redone. :-) Cheers, Wendell
|

Cart



