Function overview
Prototype
xmlSet (
_tag; _data )
Parameters
_tag
_data
Description
Tags:
XML
sets up and xml string such as <tag>data</tag>
can be nested :
xmlSet ( "TABLE" ; xmlSet ( "TR" ; xmlSet ( "TD" ; "Hello" ) & xmlSet ( "TD" ; "World" ))) = <TABLE><TR><TD>Hello</TD><TD>World</TD></TR></TABLE>
Examples
Sample input
xmlSet ( "TABLE" ; xmlSet ( "TR" ; xmlSet ( "TD" ; "Hello" ) & xmlSet ( "TD" ; "World" )))
Sample output
<TABLE><TR><TD>Hello</TD><TD>World</TD></TR></TABLE>
Function code
/*
xmlSet ( _tag ; _data )
by Fabrice Nordmann
http://www.1-more-thing.com
v.1, Dec 2007
sets up and xml string such as <tag>data</tag>
can be nested :
xmlSet ( "TABLE" ; xmlSet ( "TR" ; xmlSet ( "TD" ; "Hello" ) & xmlSet ( "TD" ; "World" ))) = <TABLE><TR><TD>Hello</TD><TD>World</TD></TR></TABLE>
*/
"<" & _tag & ">" & _data & "</" & _tag & ">"
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/109
Prototype: xmlSet( _tag; _data )
Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
Last updated: 07 February 2010
Version: 1.2
*/
// ===================================
/*__LITBR__xmlSet ( _tag ; _data )__LITBR____LITBR__by Fabrice Nordmann__LITBR__http://www.1-more-thing.com__LITBR____LITBR__v.1, Dec 2007__LITBR____LITBR____LITBR__sets up and xml string such as <tag>data</tag>__LITBR__can be nested :__LITBR__xmlSet ( "TABLE" ; xmlSet ( "TR" ; xmlSet ( "TD" ; "Hello" ) & xmlSet ( "TD" ; "World" ))) = <TABLE><TR><TD>Hello</TD><TD>World</TD></TR></TABLE>__LITBR__*/__LITBR____LITBR____LITBR__"<" & _tag & ">" & _data & "</" & _tag & ">"__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/109__LITBR____LITBR__ Prototype: xmlSet( _tag; _data )__LITBR__ Function Author: Fabrice (http://www.fmfunctions.com/mid/37)__LITBR__ Last updated: 07 February 2010__LITBR__ Version: 1.2__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.
Comments
12 May 2009
How can we do to replace the content of one tag in a pseudo-xml string?
22 May 2009
what you can do is : (requires xmlSet and xmlGet )
Let ([
_xml = $yourXMLhere
; _tagToReplace = $theTagToReplaceHere
; _newValue = $theNewValueHere
; _string = xmlGet ( _xml ; _tagToReplace )
];
Replace ( _xml ; position ( _xml ; _string ; 0 ; 1 ) ; length ( _string ) ; xmlSet ( _tagToReplace ; _newValue ))
)
(Edited by Fabrice on 22/05/09 )