File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes need something similoiar to arrays in XSLT.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "need something similoiar to arrays in XSLT.." Watch "need something similoiar to arrays in XSLT.." New topic

need something similoiar to arrays in XSLT..

Sarran Vidyakumar

Joined: Mar 26, 2003
Posts: 28
I have a xml file whick looks like

<data col="1">xxxx</data>
<data col="2">rrrr</data>
<data col="3">jjjj</data>
<data col="4">tttt</data>
<data col="5">yyyy</data>
<data col="6">zzzz</data>

I need to write an xsl file which takes in parameters{say 2,4,6}{ these r dynamic and can be any values//any number}...and deletes elements with col attribute value 2,4,6 and the xml will look like

<data col="1">xxxx</data>
<data col="3">jjjj</data>
<data col="5">yyyy</data>

any suggestions on doin this ??? Thanks
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
You should select all the other nodes except those you want to "delete".

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: need something similoiar to arrays in XSLT..
Similar Threads
XSL 2.0 (looking for ideas)
XSL distinct values
xsl for xml tags with similar name
xsl: create href for one tag with value in param among multiple
can any one explain Two -Dimensional Arrays (code)