Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Node

Status
Not open for further replies.

kyern

Programmer
Mar 30, 2006
36
US
I am working with a wordml document. In the tag <w:pict> there is <w:binData> or there is some vml. Right now anything with the <w:binData> is working great. Right now I am just doing

<xsl:template match="w:pict">

After this I need to create a case statement. If the next tag is <w:binData> then perform like normal. Otherwise fully copy the vml node into the code. I have been trying to figure out how to test if the next tag is w:binData and am not having any luck. I need to figure out how to do that and figure out how to copy everything between <w:pict> if it the next tag isn't <w:binData>. Any help would be appreciated.

David
 
Something like this, perhaps?
Code:
<xsl:choose>
<xsl:when  test="count(*[local-name()='binData'])">
[COLOR=blue]... do what is working here ... [/color]
</xsl:when>
<xsl:otherwise>
[COLOR=blue]<!-- do a deep copy of all the child elements -->[/color]
<xsl:copy-of select="*"/>
</xsl:otherwise>
</xsl:choose>

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top