Hi Dan,
xf:include/@src is interpreted at load time, like some preprocessor
instruction, so it is not possible to use it for this use case.
Is xf:upload used to upload the SVG image? If so, I have just
experimented adding support for "string" type!
My test case is:
<html xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SVG Upload+Preview</title>
<xforms:model>
<xforms:instance xmlns="">
<data>
<content/>
</data>
</xforms:instance>
</xforms:model>
</head>
<body>
<h1>Uploads and types</h1>
<p>
<xforms:upload ref="content" incremental="true">
<xforms:label>Upload: </xforms:label>
</xforms:upload>
<br/>
<xforms:output value="content" mediatype="application/xhtml+xml">
<xforms:label>Content: </xforms:label>
</xforms:output>
</p>
</body>
</html>
This is not committed yet. Is it what you are looking for?
--Alain
Le 26/09/2014 16:24, Dan McCreary a écrit :
Hi folks,
I have a form that the user is uploading a SVG image and I would like
to show a preview of it after the file has been selected.
I have seen that the <xf:include src=""> element allows us to place
the SVG image in the form like this:
<xf:include src="images/blue-circle.svg"/>
Here is the example on github:
https://github.com/AlainCouthures/xsltforms/blob/master/testsuite/samples/flags.xhtml
Is there a way to dynamically load the image? I tried:
<xf:include src="images/{$filename}"/>
but that did not work.
Perhaps some combination of an XForms on-change event and xf:load?
Thanks! - Dan
--
Dan McCreary
http://danmccreary.com
Co-author: Making Sense of NoSQL <http://manning.com/mccreary>
office: (952) 931-9198
cell: (612) 986-1552
skype: dmccreary47
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support