|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Adding element to xml snippet using xslt
David Carlisle wrote:
I did include <xsl:apply-templates/> as follows, but it does not yield the 'drillOutDir' node in the output xml.Hi: I was able to tackle the 'drillOutDir' node in the following way -- <xsl:template match="abc:configuration"> <xsl:element name="drillOutDir"> <xsl:value-of select="abc:configuration/drillOutDir"/> </xsl:element> </xsl:template> This results in the correct output xml doc ie <abc:configuration> <drillOutDir></drillOutDir> </abc:configuration> Now the only issue remaining is for the 'started' element node, which is at the same level as the 'drillOutDir' node but apparently needs to be merged using xslt. ie I can insert the following in the above template <xsl:element name="started"> <xsl:attribute name="status"><xsl:text>true</xsl:text></xsl:attribute> </xsl:element> But I do not want to hardcode the value of the attribute status in my xslt. I would like to get it using the value of or something expression. Apparently when I use the value-of or any other copy-of select clause, I only get an empty 'started' node. <xsl:copy-of select="@status[. = 'true' ]"/> <xsl:value-of select="abc:configuration/started"/> How can I resolve this part? Thanks. also as once you do apply templates to this drillOutDir element and so
|
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








