Wise words, xslt is our shared language - it's far easier to work with than paragraphs of text.

Asking questions on a mailing list to extract answers from people is a skill

On 31 Jan 2014 05:37, "Dimitre Novatchev" <dnovatchev@gmail.com> wrote:
>
> Dear Ihe,
>
> Once again it is very difficult to understand what is your problem --
> the provided information is not sufficient.
>
> It would be a good step forward if in future questions you provide:
>
> 1. A complete, but as small as possible source XML document.
>
> 2. A complete, but as small as possible XSLT transformation.
>
> 3. The currently produced result.
>
> 4. The wanted result.
>
> 5. What are the requirements that the transformation should implement
> and why the currently-produced result isn't correct.
>
> Providing this information will save you a lot of time (not having to
> read answers that aren't reflecting what you had in mind (but didn't
> express)) and will also save the time of the readers of the question.
>
> Also, you will get more answers that are correct, and quicker.
>
>
>
> On Thu, Jan 30, 2014 at 8:12 PM, Ihe Onwuka <ihe.onwuka@gmail.com> wrote:
> > So I want to match on <a> elements.
> >
> > What I want to do in the template rule however is dependent on an
> > attribute in the parent of the <a> element that conveys the data
> > source.
> >
> > I could do
> >
> >  <xsl:template match="a[contains(../@attr,'datasource1')]">
> >    blah
> >    blah
> > </xsl:template>
> >
> >  <xsl:template match="a[contains(../@attr,'datasource2'])">
> >    blah
> >    blah
> > </xsl:template>
> >
> > and it should work, but that means I am testing the contains condition
> > on every iteration of <a> element but it will return the same value
> > for every iteration and hence is unsatisfactory.
> >
> > Any advances on this.
> >
> > ------------------------------------------------------------------------------
> > WatchGuard Dimension instantly turns raw network data into actionable
> > security intelligence. It gives you real-time visual feedback on key
> > security issues and trends.  Skip the complicated setup - simply import
> > a virtual appliance and go from zero to informed in seconds.
> > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> > _______________________________________________
> > saxon-help mailing list archived at http://saxon.markmail.org/
> > saxon-help@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
>
> --
> Cheers,
> Dimitre Novatchev
> ---------------------------------------
> Truly great madness cannot be achieved without significant intelligence.
> ---------------------------------------
> To invent, you need a good imagination and a pile of junk
> -------------------------------------
> Never fight an inanimate object
> -------------------------------------
> To avoid situations in which you might make mistakes may be the
> biggest mistake of all
> ------------------------------------
> Quality means doing it right when no one is looking.
> -------------------------------------
> You've achieved success in your field when you don't know whether what
> you're doing is work or play
> -------------------------------------
> To achieve the impossible dream, try going to sleep.
> -------------------------------------
> Facts do not cease to exist because they are ignored.
> -------------------------------------
> Typing monkeys will write all Shakespeare's works in 200yrs.Will they
> write all patents, too? :)
> -------------------------------------
> I finally figured out the only reason to be alive is to enjoy it.
>
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends.  Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> saxon-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/saxon-help