Forum Discussion

mgouda's avatar
mgouda
Occasional Contributor
13 years ago

XML Attribute as Parameter

Hi,
Can you share the syntax to use to be able to make an XML attribute as a parameter.

For example putting a parameter here works fine,
<Book>${BookName}</Book>


However, this one doesnt work and the curly brackets are ignored and not treated as a parameter,
<Book Name=${BookName} />

Is there a way to handle this case?

2 Replies

  • RJanecek's avatar
    RJanecek
    Regular Contributor
    in groovy script you can set value:
    attribute = "someAtributte"  

    then you must save this:
    context.setProperty( "attribute", attribute ) 
    and then you can call this in soap request:
          <Element nameOfAtribute="${attribute}">