Re: [Xsltforms-support] External sources in 1.5beta
Brought to you by:
alain-couthures
|
From: Ryan R. <rya...@li...> - 2020-06-16 13:28:38
|
That makes sense. Thank you for your quick reply! I made a bit more progress, then ran into an error trying to use dynamic labels within a select.
Uncaught TypeError: Cannot read property 'xpath_evaluate' of null
at XsltForms_binding.bind_evaluate (xsltforms.js:5576)
at XsltForms_itemset.XsltForms_element.evaluateBinding (xsltforms.js:12334)
at XsltForms_itemset.build_ (xsltforms.js:13714)
at XsltForms_itemset.XsltForms_element.build (xsltforms.js:12316)
at Object.build (xsltforms.js:2616)
at Object.build (xsltforms.js:2647)
at Object.build (xsltforms.js:2647)
at Object.build (xsltforms.js:2647)
at Object.refresh (xsltforms.js:2570)
at init (xsltforms.js:2491)
I realize my xpath may be wrong, but that doesn't seem to be what the error indicates. I will try to dig in further after several meetings I have today. I've included my sources below.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test</title>
<link type="text/css" href="vendor/xsltforms/xsltforms.css" rel="stylesheet">
<script type="text/javascript" src="vendor/xsltforms/xsltforms.js"></script>
</head>
<body>
<xforms-model>
<xforms-instance id="data" xf-resource="data.xml"></xforms-instance>
<xforms-instance id="available-files" xf-resource="available-files.xml"></xforms-instance>
</xforms-model>
<xforms-select xf-ref="selectedFile" xf-selection="closed" xf-appearance="full">
<xforms-label>File:</xforms-label>
<xforms-itemset xf-nodset="instance('available-files')/file">
<xforms-label xf-ref="@label" />
<xforms-value xf-ref="@path" />
</xforms-itemset>
</xforms-select>
<br>
<xforms-output xf-value="concat('You selected ', selectedFile, '.')">
<xforms-label>Output: </xforms-label>
</xforms-output>
</body>
</html>
data.xml
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns="">
<selectedFile type="xs:string" />
</data>
available-files.xml
<?xml version="1.0" encoding="UTF-8"?>
<files xmlns="">
<file label="favicon.ico" path="/favicon.ico" />
<file label="manifest" path="/site.manifest" />
</files>
Cheers,
Ryan
________________________________
From: Alain Couthures <ala...@ag...>
Sent: Tuesday, June 16, 2020 8:08 AM
To: Ryan Riley <rya...@li...>; xsl...@li... <xsl...@li...>
Subject: Re: [Xsltforms-support] External sources in 1.5beta
Because HTML5 attributes such as @selected are typed, XSLTForms 1.5beta has to avoid potential conflicts: except @id, @style and @class, every attribute for an XForms element is renamed with the "xf-" prefix for HTML5.
HTML5 also considers that custom elements cannot be written with the auto-close notation.
So, you should try again this: <xforms-instance xf-src="..."></xforms-instance>
Thank you for your feedback!
--Alain
Le 16 juin 2020 à 14:45, Ryan Riley <rya...@li...> a écrit :
I was delighted to find XSLTForms. I noticed you just published the 1.5beta that supports HTML5 documents and have been trying to use it for a recent project.
I was trying to determine whether I could load external XML files using <xforms-instance src="" /> in an HTML5 document, but I receive an error with this approach:
[cid:a02a5b6f-708b-47e9-bfc3-4d94046406a1]
Is this expected? If so, how might I go about replacing the XML document within the <script type="application/xml"></script>, as in the sample hello.htm?
Thank you,
Ryan Riley
rya...@li...
_______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support
|