Re: [Xsltforms-support] Preview XML
Brought to you by:
alain-couthures
|
From: Josselin M. <mor...@gm...> - 2022-05-23 17:28:43
|
Hi Winona,
Did you try the serialize() function with the xf:ouput element ? You could also add a xf:dialog with the serialized view before saving (see sample below)
Best,
Josselin
<?xml-stylesheet href="xsltforms.xsl" type="text/xsl"?>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
lang="en">
<head>
<title>serialize() with XForms</title>
<xf:model>
<xf:instance>
<foo xmlns="">
<bar/>
</foo>
</xf:instance>
</xf:model>
</head>
<body>
<xf:input ref="bar">
<xf:label>Enter your name</xf:label>
</xf:input>
<xf:trigger>
<xf:label>Save</xf:label>
<xf:action ev:event="DOMActivate">
<xf:show dialog="serializedView"/>
</xf:action>
</xf:trigger>
<xf:dialog id="serializedView">
<xf:output value="serialize(/foo)"/>
<xf:trigger>
<xf:label>Cancel</xf:label>
<xf:hide ev:event="DOMActivate" dialog="serializedView"/>
</xf:trigger>
<xf:submit submission="submit">
<xf:label>Save</xf:label>
</xf:submit>
</xf:dialog>
</body>
</html>
> Le 23 mai 2022 à 15:05, Winona Salesky <wsa...@gm...> a écrit :
>
> Does anyone here have clever way to preview the working XML instance? I would like users to be able to see what the XML content looks like before saving it.
> Thanks!
> -Winona
>
> _______________________________________________
> Xsltforms-support mailing list
> Xsl...@li...
> https://lists.sourceforge.net/lists/listinfo/xsltforms-support
|