I need an help regarding the XSL ,please find my xml below
<TEST xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xmlns:i="http://www.w3.org/2001/XMLSchemainstance">
<TEST>
<TEST1>
<TEST2>
<A>
<Rule>e1fa7f63820a406bb97f1c1b11af8d09</Rule>
<MountPoint>0</MountPoint>
</A>
<A>
<Rule>917271928cea4a75bdfa903b49ed23e5</Rule>
<MountPoint>0</MountPoint>
</A>
<A>
<Rule>6b6336722d574e8285b73192ea057b45</Rule>
<MountPoint>0</MountPoint>
</A>
</TEST2>
</TEST1>
<CHECK>
<CHECK1>
<Rule>
<Name>test1</Name>
<ID>6b6336722d574e8285b73192ea057b45</ID>
<Type>DicomHeaderAttribute</Type>
<Category>SeriesDate</Category>
<Operator>Equals</Operator>
<Value>as</Value>
</Rule>
<Rule>
<Name>sdsd</Name>
<ID>e1fa7f63820a406bb97f1c1b11af8d09</ID>
<Type>DicomHeaderAttribute</Type>
<Category>SeriesInformation</Category>
<Operator>Equals</Operator>
<Value>sdsdsd</Value>
</Rule>
<Rule>
<Name>fdfdf</Name>
<ID>917271928cea4a75bdfa903b49ed23e5</ID>
<Type>DicomHeaderAttribute</Type>
<Category>ReferringPhysician</Category>
<Operator>Equals</Operator>
<Value>assd</Value>
</Rule>
</CHECK1>
</CHECK>
</TEST>
</TEST>
In the above xml i need to remove the rules matching with Category value as 'SeriesInformation'
, and also the corresponding 'A' node which matches with the ID of the 'SeriesInformation'
Rule,
The expected XML:
<TEST xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xmlns:i="http://www.w3.org/2001/XMLSchemainstance">
<TEST>
<TEST1>
<TEST2>
<A>
<Rule>917271928cea4a75bdfa903b49ed23e5</Rule>
<MountPoint>0</MountPoint>
</A>
<A>
<Rule>6b6336722d574e8285b73192ea057b45</Rule>
<MountPoint>0</MountPoint>
</A>
</TEST2>
</TEST1>
<CHECK>
<CHECK1>
<Rule>
<Name>test1</Name>
<ID>6b6336722d574e8285b73192ea057b45</ID>
<Type>DicomHeaderAttribute</Type>
<Category>SeriesDate</Category>
<Operator>Equals</Operator>
<Value>as</Value>
</Rule>
<Rule>
<Name>fdfdf</Name>
<ID>917271928cea4a75bdfa903b49ed23e5</ID>
<Type>DicomHeaderAttribute</Type>
<Category>ReferringPhysician</Category>
<Operator>Equals</Operator>
<Value>assd</Value>
</Rule>
</CHECK1>
</CHECK>
</TEST>
</TEST>
Please help in XSL.
Hi ,this is xsl iam using
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="Rule[Category = 'SeriesInformation']">
</xsl:template>
</xsl:stylesheet>
iam not able to forward after that,, iam able to delete the rule that matches with category as SeriesInformation, but after that how to delete the A nodes depending on ID iam not able to do