Re: [xslt] XPath expression question



Hi Vladimir

Try this:


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
  <result>
      <xsl:copy-of select="/mixed/*|/mixed/text()"/>
  </result>
</xsl:template>

</xsl:stylesheet>

Bernhard


>
> Please help
> How I can make copy-of for all children of current node, including text
> blocks ?
>
> My example:
>
> <mixed>
>    <subnode1/>
>    text
>    <subnode2>
> 	sub-text
>    </subnode2>
>    another text
> </mixed>
>
> with XSLT  transformation:
>
> <xsl:template match="/">
>   <result>
>     <xsl:copy-of select="/mixed/*"/>
>   </result>
> </xsl:template>
>
> I will get only sub-nodes of mixed, but How I can get all contents
> including text blocks ?
>
> I get:
> <result>
>    <subnode1/>
>    <subnode2>
> 	sub-text
>    </subnode2>
> </result>
>
> I need:
> <result>
>    <subnode1/>
>    text
>    <subnode2>
> 	sub-text
>    </subnode2>
>    another text
> </result>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]