Closed fm-swe closed 1 year ago
I tried
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:pdf="http://typo3.org/ns/Bithost/Pdfviewhelpers/ViewHelpers"
pdf:schemaLocation="https://pdfviewhelpers.bithost.ch/schema/2.2.xsd"
data-namespace-typo3-fluid="true">
notation from fluid documentation
and
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:pdf="http://typo3.org/ns/Bithost/Pdfviewhelpers/ViewHelpers"
xsi:schemaLocation="http://typo3.org/ns/Bithost/Pdfviewhelpers/ViewHelpers https://pdfviewhelpers.bithost.ch/schema/2.2.xsd"
data-namespace-typo3-fluid="true">
from pdfviehelpers documentation examples
Hi @fm-swe
The first approach you mentioned must be invalid, as the pdf
namespace does not have a schemaLocation
. It really should be the second approach we use throughout our documentation and examples:
Also see: https://www.w3.org/TR/xmlschema-1/#schema-loc
I am not sure what could be wrong in VSCode. In PhpStorm it is working, but only after you manually tell it to fetch the schema, also see: https://www.jetbrains.com/help/idea/referencing-xml-schemas-and-dtds.html
It might be that something similar is needed in VSCode.
@fm-swe Could you solve your issue?
It might be that you need an extension for validation, code completion, etc. in VSCode: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml
@maechler I tried the extension (and some others) but it still refused to work :-/ Not sure why though, when it works in phpstorm
@fm-swe It might be that these extensions do not like the default="NULL"
in the XSD for types such as e.g. xsd:boolean
. But this is just random guessing, without a detailed error message it is difficult to resolve this.
The XSD is auto-generated with typo3/fluid-schema-generator
and surely leaves room for improvement. I can check if we can improve the generated XSD next time the schema changes.
I just realized it only works for other fluid files because I have some TYPO3 Fluid specific extensions installed in vscode
The redhat "vscode-xml" extension works if I rename my templates to .xml instead of .html, so it must be filtered on file extensions if its active or not.
I was not able to find a setting to enable "vscode-xml" on (x)html files, so sadly this is probably an issue with vscode and fluid/html
Somehow autocomplete for pdf viewhelpers is not working for me, while others work fine. I'm using vscode. Is this a known problem?