Contact Us
About Us
News
Home
Main Menu
Home
Eviware Store
Downloads
Products
News
Forum
Eviware Blog
Search
FAQs
Customer Area
Support
Documentation
Tutorials
CookBook
Downloads
Forum
Login Form
Welcome,
Guest
. Please
login
or
register
.
November 22, 2008, 11:00:21 am
Username:
Password:
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Forgot your password?
How to call 'Format XML' programmatically
Welcome,
Guest
. Please
login
or
register
.
November 22, 2008, 11:00:21 am
News:
The Forums are up! Welcome to eviware.
Eviware Forum
soapUI
soapUI
How to call 'Format XML' programmatically
« previous
next »
Pages:
[
1
]
Author
Topic: How to call 'Format XML' programmatically (Read 314 times)
PeterT
Newbie
Posts: 12
How to call 'Format XML' programmatically
«
on:
March 19, 2008, 12:39:26 am »
Hi again
Does anyone know how to call 'Format XML' (as in the function available from the right-click menu when in a Request) programmatically?
I had to populate some elements in a request using the XMLParser method defined in the user docs. Usually I would use the much simpler methods on the XmlHolder class e.g.holder["//path"] = value but because I have a complex type that has 2 same named elements in them I couldn't get work out how to write to the second element.
e.g.<Accounts>
<Account>
<Value></Value>
</Account>
<Account>
<Value></Value>
</Account>
</Accounts>
Anyway, I successfully managed to update the values but the new XML generated puts each tag or end tag on a new line and appears to add whitespace to some of the existing values. When I 'Format XML' this is remedied but I need to be able to call 'Format XML' from within my script.
If anyone can let me in on how to do this that'd be great.
Cheers
Peter
Logged
omatzura
Administrator
Hero Member
Posts: 1,425
Re: How to call 'Format XML' programmatically
«
Reply #1 on:
March 19, 2008, 12:45:58 am »
Hi Peter,
try
def xml = .. create XML string..
xml = com.eviware.soapui.support.xml.XmlUtils.prettyPrintXml( xml )
Hope this helps!
regards,
/Ole
eviware.com
Logged
PeterT
Newbie
Posts: 12
Re: How to call 'Format XML' programmatically
«
Reply #2 on:
March 19, 2008, 01:21:29 am »
Awesome, it worked! Thanks for your help again Ole
Logged
Pages:
[
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> eviware general
-----------------------------
soapUI
-----------------------------
=> soapUI
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.2
|
SMF © 2006-2007, Simple Machines LLC
Loading...