OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: XSL Question



> am trying to write an xsl trasnformation that outputs
> the nodes based on what is present inside input node. 
> so here the output should be device and interface. 

Is possible as follows:

<?xml version='1.0'?>
<xsl:stylesheet 
		version="1.0" 
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:variable name="target"><xsl:value-of
select="/Condition/input"/></xsl:variable>
		
<xsl:template match="/">
	<xsl:apply-templates select="*"/>
</xsl:template>
		
<xsl:template match="*">
	<xsl:if test="name()=$target">
		<xsl:value-of select="."/>
		<xsl:value-of select="'&#x0a;'"/>
	</xsl:if>
	<xsl:apply-templates select="*"/>
</xsl:template>
</xsl:stylesheet>

Regards,
Craig Patterson
mailto:craig.patterson@police.wa.gov.au



************************************************************************************************
This email message and any attached files may contain information that is 
confidential and subject of legal privilege intended only for use by the individual 
or entity to whom they are addressed. If you are not the intended recipient or the 
person responsible for delivering the message to the intended recipient be 
advised that you have received this message in error and that any use, copying, 
circulation, forwarding, printing or publication of this message or attached files is 
strictly forbidden, as is the disclosure of the information contained therein.
If you have received this message in error, please notify the sender immediately 
and delete it from your Inbox.
************************************************************************************************