Official Content

The aim of this data type is to provide the possibility of recording XML files or strings. 


In order to be able to create an XML file or string from a GeneXus object you must define an XMLWriter data type variable and then invoke the methods needed to create the nodes that compose it.




The following procedure generates a file called MEETING.xml that contains the data for a meeting, indicating the people who participated in it and their corresponding tasks. 
	For Each
    &XMLWriter.WriteAttribute('Date', DToC(ReuFch))
    &XMLWriter.WriteElement('DATE', DToC(ReuFch))
    &XMLWriter.WriteComment('Meeting Description')    
    For Each
    For Each

The MEETING.xml file contains:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<MEETING Date="06/03/01">
   <!—Meeting’s description-->
<! [ CDATA [ Application development team’s meeting.
The meting took place on Friday at 9:30. ] ] >
   <! [ CDATA [ Write the application’s documentation ] ] >
   <! [ CDATA [ Meet with clients ] ] >
   <! [ CDATA [ Write user’s manual ] ] >
   <! [ CDATA [ Document the specifications ] ] >

Security tips

When a property or method is used to assign a file's path (or URL) do not use user's inputs concatenations or sanitize the user's entries to avoid path traversal or path manipulation vulnerability risks.


Objects: Procedures, Transactions, Web Panels
Languages: .NET, Java, Ruby (up to GeneXus X Evolution 3), Visual FoxPro (up to GeneXus X Evolution 3)

See Also


Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant