Re: [Xsltforms-support] External sources in 1.5beta
Brought to you by:
alain-couthures
|
From: Alain C. <ala...@ag...> - 2020-06-16 15:12:35
|
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
Both @nodeset and @ref are converted into @xf-ref because @nodeset is deprecated in XForms 2.0.
</div>
<div>
<br>
</div>
<div>
<xforms-label ... /> is to be replaced by <xforms-label ... ></xforms-label>
</div>
<blockquote type="cite">
Le 16 juin 2020 à 15:28, Ryan Riley <rya...@li...> a écrit :
<br>
<br>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
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.
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
Uncaught TypeError: Cannot read property 'xpath_evaluate' of null
<br>
<div>
at XsltForms_binding.bind_evaluate (xsltforms.js:5576)
<br>
</div>
<div>
at XsltForms_itemset.XsltForms_element.evaluateBinding (xsltforms.js:12334)
<br>
</div>
<div>
at XsltForms_itemset.build_ (xsltforms.js:13714)
<br>
</div>
<div>
at XsltForms_itemset.XsltForms_element.build (xsltforms.js:12316)
<br>
</div>
<div>
at Object.build (xsltforms.js:2616)
<br>
</div>
<div>
at Object.build (xsltforms.js:2647)
<br>
</div>
<div>
at Object.build (xsltforms.js:2647)
<br>
</div>
<div>
at Object.build (xsltforms.js:2647)
<br>
</div>
<div>
at Object.refresh (xsltforms.js:2570)
<br>
</div> at init (xsltforms.js:2491)
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
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.
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
<div style="color: #333333; background-color: #f5f5f5; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px;">
<div>
<span style="color: #91b3e0;"><!</span>
<span style="color: #4b69c6;">DOCTYPE</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">html</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">html</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">lang</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">en</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">head</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">meta</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">charset</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">utf-8</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">meta</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">http-equiv</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">X-UA-Compatible</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">content</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">IE=edge</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">title</span>
<span style="color: #91b3e0;">></span> Test
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">title</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">link</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">type</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">text/css</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">href</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">vendor/xsltforms/xsltforms.css</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">rel</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">stylesheet</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #777777;"> </span>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">script</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">type</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">text/javascript</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">src</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">vendor/xsltforms/xsltforms.js</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></</span>
<span style="color: #4b69c6;">script</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">head</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">body</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-model</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-instance</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">id</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">data</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-resource</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">data.xml</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></</span>
<span style="color: #4b69c6;">xforms-instance</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-instance</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">id</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">available-files</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-resource</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">available-files.xml</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></</span>
<span style="color: #4b69c6;">xforms-instance</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">xforms-model</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-select</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-ref</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">selectedFile</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-selection</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">closed</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-appearance</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">full</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-label</span>
<span style="color: #91b3e0;">></span> File:
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">xforms-label</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-itemset</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-nodset</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">instance('available-files')/file</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-label</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-ref</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">@label</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> /></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-value</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-ref</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">@path</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> /></span>
</div>
<div>
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">xforms-itemset</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">xforms-select</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">br</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-output</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xf-value</span>
<span style="color: #777777;">="</span>
<span style="color: #448c27;">concat('You selected ', selectedFile, '.')</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"><</span>
<span style="color: #4b69c6;">xforms-label</span>
<span style="color: #91b3e0;">></span> Output:
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">xforms-label</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">xforms-output</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">body</span>
<span style="color: #91b3e0;">></span>
</div>
<div>
<span style="color: #91b3e0;"></</span>
<span style="color: #4b69c6;">html</span>
<span style="color: #91b3e0;">></span>
</div>
</div>
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
data.xml
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
<div style="color: #333333; background-color: #f5f5f5; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px;">
<div>
<span style="color: #777777;"><?</span>
<span style="color: #4b69c6;">xml</span>
<span style="color: #8190a0; font-style: italic;"> version</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">1.0</span>
<span style="color: #777777;">"</span>
<span style="color: #8190a0; font-style: italic;"> encoding</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">UTF-8</span>
<span style="color: #777777;">"</span>
<span style="color: #777777;">?></span>
</div>
<div>
<span style="color: #777777;"><</span>
<span style="color: #4b69c6;">data</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xmlns</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">""</span>
<span style="color: #777777;">></span>
</div>
<div>
<span style="color: #777777;"><</span>
<span style="color: #4b69c6;">selectedFile</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">type</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">xs:string</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #777777;">/></span>
</div>
<div>
<span style="color: #777777;"></</span>
<span style="color: #4b69c6;">data</span>
<span style="color: #777777;">></span>
</div>
</div>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
available-files.xml
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
<div style="color: #333333; background-color: #f5f5f5; font-family: Consolas, 'Courier New', monospace; font-weight: normal; font-size: 14px; line-height: 19px;">
<div>
<span style="color: #777777;"><?</span>
<span style="color: #4b69c6;">xml</span>
<span style="color: #8190a0; font-style: italic;"> version</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">1.0</span>
<span style="color: #777777;">"</span>
<span style="color: #8190a0; font-style: italic;"> encoding</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">UTF-8</span>
<span style="color: #777777;">"</span>
<span style="color: #777777;">?></span>
</div>
<div>
<span style="color: #777777;"><</span>
<span style="color: #4b69c6;">files</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">xmlns</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">""</span>
<span style="color: #777777;">></span>
</div>
<div>
<span style="color: #777777;"><</span>
<span style="color: #4b69c6;">file</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">label</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">favicon.ico</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">path</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">/favicon.ico</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #777777;">/></span>
</div>
<div>
<span style="color: #777777;"><</span>
<span style="color: #4b69c6;">file</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">label</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">manifest</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #8190a0; font-style: italic;">path</span>
<span style="color: #91b3e0;">=</span>
<span style="color: #777777;">"</span>
<span style="color: #448c27;">/site.manifest</span>
<span style="color: #777777;">"</span>
<span style="color: #91b3e0;"> </span>
<span style="color: #777777;">/></span>
</div>
<div>
<span style="color: #777777;"></</span>
<span style="color: #4b69c6;">files</span>
<span style="color: #777777;">></span>
</div>
</div>
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
Cheers,
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: #000000;">
Ryan
</div>
<br>
<hr style="display: inline-block; width: 98%;">
<div dir="ltr" id="ox-1c9e7825b1-divRplyFwdMsg">
<span style="font-size: 11pt; color: #000000; font-family: Calibri, sans-serif;"><strong>From:</strong> Alain Couthures <ala...@ag...><br><strong>Sent:</strong> Tuesday, June 16, 2020 8:08 AM<br><strong>To:</strong> Ryan Riley <rya...@li...>; xsl...@li... <xsl...@li...><br><strong>Subject:</strong> Re: [Xsltforms-support] External sources in 1.5beta</span>
<div>
<br>
</div>
</div>
<div>
<div>
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.
</div>
<div>
<br>
</div>
<div>
HTML5 also considers that custom elements cannot be written with the auto-close notation.
</div>
<div>
<br>
</div>
<div>
So, you should try again this: <xforms-instance xf-src="..."></xforms-instance>
</div>
<div>
<br>
</div>
<div>
Thank you for your feedback!
</div>
<div>
<br>
</div>
<div>
--Alain
</div>
<blockquote type="cite">
Le 16 juin 2020 à 14:45, Ryan Riley <rya...@li...> a écrit :
<br>
<br>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
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.
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
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:
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
<img src="cid:a02a5b6f-708b-47e9-bfc3-4d94046406a1" style="max-width: 100%;" id="ox-1c9e7825b1-x_a02a5b6f-708b-47e9-bfc3-4d94046406a1">
<br>
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
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?
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
<br>
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
Thank you,
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
Ryan Riley
</div>
<div style="font-family: Calibri,Helvetica,sans-serif; font-size: 12pt; color: #000000;">
rya...@li...
</div>_______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support
</blockquote>
<div class="ox-1c9e7825b1-x_default-style">
<br>
</div>
</div>
</blockquote>
<div class="default-style">
<br>
</div>
</body>
</html> |