|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] stylesheet params and parsing a (MathML) string
Hi ... I have a couple of questions (apologies for the extension content
but I figured out others are using node-set a lot so thought of posting
here)
1)The easy one first: I am sending a parameter to a stylesheet with <xsl:variable name="tree">
<xsl:element name="myTree">
<xsl:attribute name="id">
<xsl:value-of select="$param1"/></xsl:attribute>
</xsl:attribute>
<xsl:value-of select="$param2"/>
</xsl:element>
</xsl:variable>I am using the node-set extension to apply templates on it <xsl:apply-templates select="exsl:node-set($variables-tree)/*"> which is then matched <xsl:template match="myTree"> ... do stuff ... </xsl:template> Ok.. This worked for me before (thanks to the article in http://www.xml.com/pub/a/2003/07/16/nodeset.html) but this time I had problems. I figured out that it has to do with namespaces that these are happening into (eg. the apply-templates is happening into a <m:mn> element) so the template is not matched. After a while I came to the (not-so-suprising) conclusion that this created element is in the xhtml namespace (which is the default of my stylesheet) hence matching: match="xhtml:myTree" works. This means that I have to declare this as well as a namespace in the stylesheet. This doesn't look a really neat way to do things. Is this the correct way or am I doing something wrong ? 2) Ok now the other part: Apart from sending values lets say that I want to send a parameter with MathML (or any XML for that matter) in it. Is there a way to "parse" it (assuming its valid etc) and include it in my tree as before. I was hoping that <xsl:copy-of select="exsl:node-set($param2)"/> would work but it obviously can't. I could start creating other files and piping things around but this solution would be neater. I saw some similiar messages about parsing a couple of years ago but I can't find something towards that direction. Thanks for all your help. Manolis XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








