• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

modify the value of an existing attribute in XSLT

 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all:
I have the following XML document
Now, I want to Modify the "name" attribute of the <schema-connection-node> tag, I would like to know if the following syntax is correct

My question is in the <xsl template match =""> if i want to specify the specific attribute, i have to use the full XPath to represent it, correct?
so it would be "schema-root-node/schema-connection-node@name", correct? since "name" is the attribute of schema-root-node/schema-connection-node
node, please let me know..

Many thanks
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Karen Lin:
My question is in the <xsl template match =""> if i want to specify the specific attribute, i have to use the full XPath to represent it, correct?
so it would be "schema-root-node/schema-connection-node@name", correct? since "name" is the attribute of schema-root-node/schema-connection-node
node, please let me know..

Many thanks



if you just specify "schema-connection-node@name" , but again its depends on your xml structure.
BTW does xsl:template really work as it is with the xpath, i guess you have to change the xpath from schema-root-node/schema-connection-node@name
to schema-root-node/schema-connection-node[@name] (i am not sure either)...searching my xslt reference book
 
reply
    Bookmark Topic Watch Topic
  • New Topic