469,611 Members | 1,933 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,611 developers. It's quick & easy.

XSLT: small changes to xml from XPath


How do I copy most of a xml file, but change a few attributes and/or
elements based on a xpath?
How do I make the xslt file?
I know this description isn't much, but here is a small example

<element atr="value"/>


<element atr="*new value*"/>
Sep 14 '07 #1
1 1456
Like below:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

<xsl:template match="node() | @*">
<xsl:apply-templates select="node() | @*"/>

<xsl:template match="element">
<xsl:attribute name="atr">*new value*</xsl:attribute>
<xsl:apply-templates select="node|@*[not(name()='atr')]"/>

Best Regards,
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/XML Editor, Schema Editor and XSLT Editor/Debugger

Sep 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jeff Kish | last post: by
4 posts views Thread by Son KwonNam | last post: by
2 posts views Thread by Matt Frame | last post: by
2 posts views Thread by Pawel | last post: by
3 posts views Thread by Ian Roddis | last post: by
1 post views Thread by Sergey Dubinets | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.