Closed Cicorione closed 6 months ago
Ok... I rectify...
Not sure what I am doing wrong but it is reading the first entry (na-fonts.xml
) only:
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en"
xmlns:xi="http://www.w3.org/2001/XInclude" >
<!-- LOAD FONTS DEFINITIONS -->
<xi:include href="na-fonts.xml"/>
<!-- LOAD COLORS DEFINITIONS -->
<xi:include href="na-colors.xml"/>
<!-- LOAD GRAPHICS DEFINITION -->
<xi:include href="na-graphics.xml"/>
<!-- LOAD MASTER PAGES -->
<xi:include href="na-masters.xml"/>
[...]
</Layout>
Thus I moved this entry in the data
file as suggested here:
<catalog xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- LOAD FONTS DEFINITIONS -->
<xi:include href="na-fonts.xml"/>
<!-- LOAD COLORS DEFINITIONS -->
<xi:include href="na-colors.xml"/>
<!-- LOAD GRAPHICS DEFINITION -->
<xi:include href="na-graphics.xml"/>
<!-- LOAD MASTER PAGES -->
<xi:include href="na-masters.xml"/>
<xi:include href="sec02.xml"/>
<!-- <xi:include href="sec03.xml"/> -->
<!-- <xi:include href="sec04.xml"/> -->
<!-- <xi:include href="sec05.xml"/> -->
<!-- <xi:include href="sec06.xml"/> -->
<!-- <xi:include href="sec07/xml"/> -->
<!-- <xi:include href="sec08.xml"/> -->
<!-- <xi:include href="sec09.xml"/> -->
<!-- <xi:include href="sec16.xml"/> -->
</catalog>
But Publisher is telling that is wrong as well... π€·ββοΈ
Thanks!!! πππ
Updates...
The documentation I was reading it wasn't updated. I followed the online documentation although I am still doing something wrong:
Ok... I read this:
Info
This command is obsolete. Use Layout instead
I am officially confused... π΅βπ« However it worked... :thinking:
Last update, I reverted everything as explained here:
https://doc.speedata.de/publisher/en/basics/fileorganization/#ch-splitlayout
However works only na-fonts.xml
even though is marked as issue:
all the external xml
use this syntax:
<Layout
xmlns="urn:speedata.de:2009/publisher/en">
<!-- Colors -->
<DefineColor name="npgray" model="cmyk" c="0" m="0" y="0" k="53" />
<DefineColor name="darknpgray" model="cmyk" c="0" m="0" y="0" k="21" />
<!-- <DefineColor name="npyellow" model="cmyk" c="0" m="30" y="90" k="0" /> -->
<DefineColor name="npyellow" model="RGB" r="255" g="178" b="25" alpha="100"/>
<DefineColor name="npyellowA" model="RGB" r="255" g="178" b="25" alpha="80"/>
<DefineColor name="npyellowAA" model="RGB" r="255" g="178" b="25" alpha="60"/>
<DefineColor name="npyellowAAA" model="RGB" r="255" g="178" b="25" alpha="40" />
<DefineColor name="npyellowAAAA" model="RGB" r="255" g="178" b="25" alpha="20" />
</Layout>
Thanks! π π
This is an issue with the XSD Schema validation that the validator comes with VSCode does not handle the XInclude
instructions automatically. I think you can safely ignore these syntax error marked by VSCode. A better validator like jing.jar
can handle XInclude instructions without issue. Also you could try RelaxNG based validator plugin like Scholarly XML for VSCode, which I believe unlike XSD Schema, allow foreign nodes like XInclude instructions.
I will try to add the xinclude to the schema.
@LdBeth
Thanks for the clarification and thanks to suggest an alternative Schema validator.
@pgundlach however I did not understand why is not reading all my xi:include
, is it because xi:include
is not defined in the schema? Did I use it the wrong way?
As I wrote here using the <Include>
tag worked even though you labeled it as obsolete.
Thanks and Happy New Year to both! πΎ
Does switching to Relax NG schema solve the problem?
Edit the catalog-schema-en.xml
file so it reads:
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="urn:speedata.de:2009/publisher/en" uri="layoutschema-en.rng"/>
</catalog>
(change the file extension of the layoutschema-en.xsd
to .rng
)
The path to the catalog can be found in the vscode setting xml.catalogs
. It should already have an entry such as publisher/schema/catalog-schema-en.xml
BTW Happy new year, too!
Hi Patrick, I am afraid that I did not understand how to use the XML Scholarly
validator...
This doesn't work:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
href="https://vault.tei-c.org/P5/current/xml/tei/custom/schema/relaxng/tei_all.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" />
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
This either:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
href="/usr/share/speedata-publisher/schema/layoutschema-en.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
<TEI xmlns="urn:speedata.de:2009/publisher/en" />
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
π©
I think to reference a local schema, the URI syntax is file:///usr/share/speedata-publisher/schema /layoutschema-en.rng
Thanks, this worked out:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
file="///usr/share/speedata-publisher/schema/layoutschema-en.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
[...]
</Layout>
Publisher read all the xi:include
and let the layout being properly designed, however I haven't been able to make the suggestions/autocompletion working yet... π€
Thanks, this worked out:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
file="///usr/share/speedata-publisher/schema/layoutschema-en.rng"
schematypens="http://relaxng.org/ns/structure/1.0"
type="application/xml"?>
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
[...]
</Layout>
Publisher
read all the xi:include
entries and let the layout being properly designed, however I haven't been able to make the suggestions/autocompletion working yet and it looks like I am not alone: https://github.com/raffazizzi/vscode-sxml/issues/20
Anyway as suggested in the same documentation this plugins requires additional other plugins to close tags:
Recommended extensions
For a better XML editing experience we recommend also installing the following extensions:
Perhaps it would work even with RH XML plugin using RelaxNG
instead of XML schema
... π€ Tomorrow I'll give it a try!
I assumed you use the RedHat XML plugin. Sorry. I should have asked. I have instructions here: https://doc.speedata.de/publisher/en/appendix-schema-assigning/schema-vscode/
Patrick, I thought that you were asking me to test the other validator, and I was really interested in it because the RH XML plugin has a nasty memory behavior and suddenly it fills out all my RAM and my SWAP let the VSCode crashing on my cheap crapbook.
So the author of XML Scholarly
came to rescue me and provided the solution:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
href="https://raw.githubusercontent.com/speedata/publisher/develop/schema/layoutschema-en.rng"
type="application/xml"
schematypens="http://relaxng.org/ns/structure/1.0"?>
<Layout xmlns="urn:speedata.de:2009/publisher/en"
xmlns:sd="urn:speedata:2009/publisher/functions/en">
[...]
</Layout>
However I am not sure this is correct: href="https://raw.githubusercontent.com/speedata/publisher/develop/schema/layoutschema-de.rng"
Perhaps I should use: href="file:///usr/share/speedata-publisher/schema/layoutschema-en.rng"
... π€ (which is not currently working)
Anyway this is cool now there are two ways to use Schema/RelaxNG with VScode, perhaps you can provide an official link instead of this: https://raw.githubusercontent.com/speedata/publisher/develop/schema/layoutschema-en.rng
; unless this is totally legitimate... Thanks! π
Both href="https://raw.githubusercontent.com/speedata/publisher/develop/schema/layoutschema-de.rng"
and href="file:///usr/share/speedata-publisher/schema/layoutschema-en.rng"
could work, however with the RedHat XML mode only the local files seem to work.
This issue can be closed?
I say yes, so to use xi:include
it must be used RelaxNG
instead of XML Schema
, is that correct?
Thanks... π
That is correct and I have added a note in the documentation for the next release. Thank you for opening this issue.
Only for the record local RelaxNG
files can (on *nix*
) recalled by Scholarly XML
this way:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
href="/usr/share/speedata-publisher/schema/layoutschema-en.rng"
type="application/xml"
schematypens="http://relaxng.org/ns/structure/1.0"?>
Thanks π
Hi Patrick, Merry Christmas!!! π
I am following this instructions:
However
VSCode
is reading it as issue:na-fonts.xml
Publisher
Thanks!!! π