![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Match an attribute value in a set of possible values [Thread Next] Re: Match an attribute value in a set of possible valuesTo: NULL Date: 9/1/2006 4:58:00 PM
patrin wrote:
> Thanks for the quick replay, but the list of ids to match is dynamyc
> and I know it only from Java code, where it is stored into a String
> arrray:
>
> String[] idsToRemove = {1,3,...};
>
> and I would like to pass it to the Transformer, invoking the method:
>
> setParameter("idsToRemove", idsToRemove);
>
> so that the XSLT should remove all the child elements whose test
> subelement has an id with any of the values contained in the
> idsToRemove array.
>
> Is it possible to do this with XSLT 1.0 ?
I guess there are two approaches, one that might be processor dependent
where you need to look at the documentation of the XSLT processor what
kind of types you can pass in with setParameter:
The setParameter method
<http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/Transformer.html#setParameter(java.lang.String,%20java.lang.Object)>
as the second argument takes any object so it might well be that it
works to pass in a Source (e.g. DOMSource or SAXSource or StreamSource)
there as well. But details depend on the XSLT processor, I don't think I
have tried that so far with Saxon or Xalan.
The second approach would take the XSLT stylesheet as an XML document
and change it as needed depending on your idsToRemove before the
stylesheet is used for the transformation.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
