[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

stylesheet params and parsing a (MathML) string

Subject: stylesheet params and parsing a (MathML) string
From: Manolis Mavrikis <M.Mavrikis@xxxxxxxx>
Date: Sun, 23 Nov 2003 22:05:40 +0000
parsing mathml
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.