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? Re: NOT equal checking for node?To: NULL Date: 12/1/2005 9:53:00 PM This is basics -- you need to read a good book. Use the XPath not() function and the "=" operator. Almost never use the "!=" operator, especially if you are not 100% sure you know what you're doing... 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 | |||
|
