Ask and answer questions about WebRatio, WebML and BPMN

Ciao, io avrei bisogno di estrarre un file xml con tutti i dati di un'entità, ma non riesco a farlo. Io creo inizialmente una XMLOutUnit successivamente aggiungo una XMLOutEntity e setto l'entità che mi interessa e i vari attributes. Come risultato quando eseguo il programma non ho nessun file di output xml. In cosa sbaglio?

asked 16 Jan, 18:45

bruno.buccarella's gravatar image

bruno.buccar...
023
accept rate: 0%

volevamo inoltre sapere dove viene salvato il file xml. Grazie

(16 Jan, 18:59) michele.cacace

Ciao,

l'XML Out Unit restituisce sul Link in uscita un xml Document. Per ottenere fisicamente sul file system il file xml si può usare una Script Unit che prende in ingresso il Document e salva il file.


Hi,

the XML Out Unit returns an xml Document by the outgoing Link. In order to obtain the file on the file system you can use a Script Unit, it takes in input the Document and saves the file.

Ad esempio / For example:

#input Document myXML
import org.apache.commons.io.FileUtils;

String uploadDir = rtx.getUploadDirectory(); // default upload directory
File myXMLDoc = new File(uploadDir +"\\myXMLDoc.xml"); 
myXMLDoc.createNewFile(); 
FileUtils.writeStringToFile(myXMLDoc, myXML.asXML())
link

answered 18 Jan, 11:03

albertomolinaroli's gravatar image

albertomolin...
63424
accept rate: 62%

Grazie! Funziona perfettamente.

link

answered 22 Jan, 17:20

bruno.buccarella's gravatar image

bruno.buccar...
023
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1

Asked: 16 Jan, 18:45

Seen: 218 times

Last updated: 22 Jan, 17:20

Related questions

©2001-2011 Web Models s.r.l. All rights reserved