difficult xsl transform

Discussion in 'HTML' started by Greg, Dec 19, 2003.

  1. Greg

    Greg Guest

    I need to transform:
    <A> x <\A>
    <A> y <\A>
    <B> i <\B>
    <B> j <\B>
    <B> k <\B>

    into:
    <A>
    <P> x <\P>
    <P> y <\P>
    </A>
    <B>
    <P> i <\P>
    <P> j <\P>
    <P> k <\P>
    </B>

    There seems no easy way to do that. Am I missing somethig? I tried
    using variables, but they cannot be reassigned within the same
    context. Anyone?

    Thx
     
    Greg, Dec 19, 2003
    #1
    1. Advertising

  2. Greg

    Rowland Shaw Guest

    <xsl:template match="foo">
    <A>
    <xsl:for-each select="A">
    <P><xsl:value-of select="text()" /></P>
    </xsl:for-each>
    </A>
    <B>
    <xsl:for-each select="B">
    <P><xsl:value-of select="text()" /></P>
    </xsl:for-each>
    </B>
    </xsl:template>


    "Greg" <> wrote...
    > I need to transform:
    > <A> x <\A>
    > <A> y <\A>
    > <B> i <\B>
    > <B> j <\B>
    > <B> k <\B>
    >
    > into:
    > <A>
    > <P> x <\P>
    > <P> y <\P>
    > </A>
    > <B>
    > <P> i <\P>
    > <P> j <\P>
    > <P> k <\P>
    > </B>
    >
    > There seems no easy way to do that. Am I missing somethig? I tried
    > using variables, but they cannot be reassigned within the same
    > context. Anyone?
    >
    > Thx
     
    Rowland Shaw, Dec 19, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg
    Replies:
    1
    Views:
    321
    Colin Savage
    Dec 19, 2003
  2. Greg

    difficult xsl transform

    Greg, Dec 19, 2003, in forum: XML
    Replies:
    1
    Views:
    330
    Rowland Shaw
    Dec 19, 2003
  3. Greg
    Replies:
    1
    Views:
    326
    Colin Savage
    Dec 19, 2003
  4. Greg

    difficult xsl transform

    Greg, Dec 19, 2003, in forum: Javascript
    Replies:
    1
    Views:
    95
    Rowland Shaw
    Dec 19, 2003
  5. Greg
    Replies:
    1
    Views:
    82
    Colin Savage
    Dec 19, 2003
Loading...

Share This Page