Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XSL: NOT equal checking for node? [Thread Next] Re: NOT equal checking for node?To: NULL Date: 12/2/2005 6:08:00 AM > How do I say: "for all nodes that are NOT H, X and Z, do this:" ? In XSLT one doesn't need to specifically write this. you will have two templates: <xsl:template match="*"> <!-- Whatever general transformation necessary here --> </xsl:template> <xsl:template match="H | X | Z"> <!-- A more specialized transformation here --> </xsl:template> The second template overrides the first for elements of type H, X, Z. Just try it :o) Cheers, Dimitre Novatchev <Piper707@h...> wrote in message news:1133433095.424099.72260@g...... > Hi, > > I need to know how I can check to see if a particular node is NOT equal > to a SET of values. > > i.e. a valid form of : <xsl:template match!="H" && match!="Y"&& > match!="Z"> > > I have an XML document of the foll format: > > <ROOT> > <A>1</A> > <B>2</B> > <C>3</C> > .... > <H>4</H> > ... > </ROOT> > > I need to transform this into another format. Only the nodes <H>, <X>, > <Z> need special handling, which i refer to, via a corresponding > template calls. > > All the other nodes, need to be transformed like this: > > <A>1</A> becomes <A><Value>1</Value></A> > > My xsl looks something like this: > > <xsl:template match="/"> > <NEWFORM> > <xsl:apply-templates/> > </NEWFORM> > </xsl:template> > > /****template calls for H, X, Z**********/ > > <xsl:template match="H"> > //special handling for <H> > </xsl:template> > > How do I say: "for all nodes that are NOT H, X and Z, do this:" ? > > something like: > > for each child of root > not equal to X, H, Z > do the following: > > Thanks for any help > Rohit. > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
