Содержание
- Validation failed: no DTD found #1351
- Comments
- Validity error : no DTD found #79
- Comments
- Confusing error message following xmllint instructions #240
- Comments
Validation failed: no DTD found #1351
Getting the error Validation failed: no DTD found, on Windows
i have this bash that works fine in Linux, but when i try to execute on Windows i get the error.
set -e
SQLMODEL=»./database/model.sql»
pgmodeler-cli -if ./database/model.dbm -ef -of $SQLMODEL &&
sed -i ‘1s/^/CREATE DATABASE db_name;nc db_name;n/’ $SQLMODEL
[0] src/syntaxhighlighter.cpp (580)
void SyntaxHighlighter::loadConfiguration(const QString&)
[LibXMLError] Error while interpreting XML buffer at line 0 column 0.
Message generated by the parser: Validation failed: no DTD found !.
[1] src/xmlparser.cpp (92)
void XmlParser::loadXMLFile(const QString&)
[LibXMLError] Error while interpreting XML buffer at line 0 column 0.
Message generated by the parser: Validation failed: no DTD found !.
[2] src/xmlparser.cpp (123)
void XmlParser::loadXMLBuffer(const QString&)
[LibXMLError] Error while interpreting XML buffer at line 0 column 0.
Message generated by the parser: Validation failed: no DTD found !.
[3] src/xmlparser.cpp (199)
void XmlParser::readBuffer()
[LibXMLError] Error while interpreting XML buffer at line 0 column 0.
Message generated by the parser: Validation failed: no DTD found !.
** pgmodeler-cli aborted due to critical error(s). **
I/O error : failed to load external entity «E:/PROYECTO-Drillit/server/conf/dtd/source-code-highlight.dtd»
highlight SYSTEM «E:/PROYECTO-Drillit/server/conf/dtd/source-code-highlight.dtd»
^
validity error : Validation failed: no DTD found !
I want to ask if there is a way to set up the path where pgmodeler go to find conf folder. That i
think will solve the issue.
- OS: Windows
- Version: 10
- pgModeler version: 0.92
- Qt version:
The text was updated successfully, but these errors were encountered:
Источник
Validity error : no DTD found #79
I have a some bug or something similar.
The text was updated successfully, but these errors were encountered:
you need to make the DTD schema files available at:
make install does not copy the files, yet. You can change the schema path by setting the following environment variables:
Hi,
Sorry, but what is «DTD schema files»? I haven’t /usr/local/share/xml/schema/apt-dater dir in my system.
The schema files are schema/*.dtd within the sources. They should be get installed during make install .
And if I don’t want to install apt-dater in my system. Can i just copy this files into property directory on my system? Just without make install .
This will work. The make install for the schema directory just copies the files:
Use the environment variables while running ./configure as quoted above (the paths specified at configure-time are used in apt-dater and the example .xml config files):
There was a missing escape sequence in schema/Makefile.am which has been fixed by 3830e75.
PS: Please provide error messages in LANG=C.
I just can’t understand what a must do to get success result.
But WHY? What happened?
This seems not to be an issue of apt-dater . I’ve referenced the help text twice howto configure the destination of the XML schema files.
In case you get this bug, like I did, the correct answer is that for a while apt-dater has created an XML config without DTD validation, while now it requires it. It has nothing to do with environment variables.
If you used apt-dater during this time, your current configuration file must be adapted.
There are a few other new sections needed to make it run, therefore I suggest you move your current configuration out of the way (mv
Источник
Confusing error message following xmllint instructions #240
The CONTRIBUTING docs say to run:
However, when I run this I get the following unhelpful, self-contradictory message:
(Following the online validation instructions, I got no errors.)
The text was updated successfully, but these errors were encountered:
The last line is the one that matters. It can’t find a DTD (which is fine, since we’re using an XSD instead of a DTD), and originally fails to validate because of that. Then it realizes everything’s okay because it has a schema.
I tend to use jing in addition to xmllint since that actually checks the ID/IDREF values.
Should we update the documentation to show that this confusing message actually means «success»?
Yeah, I think including a sample of the expected output and adding a note to ignore the first two lines would be a fine way to go:
Regarding the ID/IDREF values, I was finding that xmllint was also noticing bad values, though it doesn’t seem to notice all bad values, which was strange. I’m not sure I know the pattern of which errors it was able to find and which it wasn’t.
Oh, and better yet would be if xmllint has a flag to make the spurious error go away. I didn’t find one on a quick scan of the help though.
FYI, if I remove —postvalid and just run—
It works without the spurious message and seems to catch errors okay. Is there a case where —postvalid is necessary to catch something? (Here is where I saw an example of checking against an XSD rather than a DTD.)
Источник
I’m certain this is some sort of installation error on my part, but I’m having trouble getting a document to compile on my Mac OS X 10.11.6 laptop. Here’s the output:
$ make asciidoc-guide
GEN distclean-asciidoc-guide
a2x -v -f pdf doc/src/guide/book.asciidoc && mv doc/src/guide/book.pdf doc/guide.pdf
a2x: args: ['--dblatex-opts', '-P latex.output.revhistory=0 -P doc.publisher.show=0 -P index.numbered=0', '--xsltproc-opts', '--stringparam use.id.as.filename 1', '-d', 'book', '--attribute', 'tabsize=4', '-v', '-f', 'pdf', 'doc/src/guide/book.asciidoc']
a2x: resource files: []
a2x: resource directories: ['/usr/local/etc/asciidoc/images', '/usr/local/etc/asciidoc/stylesheets']
a2x: executing: "/usr/local/bin/asciidoc.py" --backend docbook -a "a2x-format=pdf" --doctype book --attribute "tabsize=4" --verbose --out-file "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml" "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.asciidoc"
asciidoc: reading: /usr/local/etc/asciidoc/asciidoc.conf
asciidoc: reading: /Users/jay/GitPeg/Tokenizer/doc/src/guide/book.asciidoc
asciidoc: reading: /usr/local/etc/asciidoc/docbook45.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/code/code-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/graphviz/graphviz-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/latex/latex-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/music/music-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/source/source-highlight-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/lang-en.conf
asciidoc: writing: /Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml
asciidoc: include: /Users/jay/GitPeg/Tokenizer/doc/src/guide/overview.asciidoc
asciidoc: book.asciidoc: line 8: reading: /Users/jay/GitPeg/Tokenizer/doc/src/guide/overview.asciidoc
a2x: executing: "xmllint" --nonet --noout --valid "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml"
/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
^
/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml:6: validity error : Validation failed: no DTD found !
<book lang="en">
^
a2x: ERROR: "xmllint" --nonet --noout --valid "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml" returned non-zero exit status 4
make: *** [erlang.mk:5238: asciidoc-guide] Error 1
I’ve been trying to install according to this http://stackoverflow.com/questions/13519203/git-compilingdocumentation-git-add-xml-does-not-validate
I don’t have brew or fink, so I installed http://www.linuxfromscratch.org/blfs/view/cvs/pst/xmlto.html by hand doing the steps for docbook-xml-4.5, docbook-xsl-1.79.1, and libxslt-1.1.29. I built dblatex-0.3.9 and asciidoc-8.6.9 from source.
I installed the catalog stuff in /usr/local/etc/xml/catalog and /usr/local/etc/xml/docbook, updated the $XML_CATALOG_FILES env. Running ‘xmllint —help’ it said it looks in /etc/xml/catalog by default so I made that a symbolic link to my /usr/local/etc/xml/catalog just in case.
$ ls -l /etc/xml/catalog
lrwxr-xr-x 1 root wheel 26 Dec 17 08:24 /etc/xml/catalog -> /usr/local/etc/xml/catalog
$ file !$
file /etc/xml/catalog
/etc/xml/catalog: XML document text
$ cat !$
cat /etc/xml/catalog
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///usr/local/etc/xml/docbook"/>
</catalog>
$ cat /usr/local/etc/xml/docbook
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.5" rewritePrefix="file:///usr/local/etc/xml/docbook/xml-dtd-4.5"/>
</catalog>
Any clues what else I need to do?
- Remove From My Forums
-
Question
-
I have a process that generates an XML file that I need to then validate against a DTD. Since the XML file is a fragment of a larger document, the XML file cannot have a DOCTYPE within it.
The code to open and try to validate is:
Code Snippet
XmlReaderSettings xmlSetting = new XmlReaderSettings();
xmlSetting.ProhibitDtd = false;
xmlSetting.ValidationType = ValidationType.DTD;
xmlSetting.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);string strFile = «8091000000024.xml»;
{
XmlReader xmlread = XmlReader.Create(strFile, xmlSetting, xmlParser);
while (xmlread.Read())
{
}xmlread.Close();
}The ValidationCallback is a simple function that stores the validation error in a string.
The start of the XML is
Code Snippet
<?xml version=»1.0″ encoding=»UTF-8″?><servinfo id=»8091000000024″ refid=»9100″><title>DESCRIPTION</title>…
Yes I know that IDs have to start with a letter. I need help in getting the validation working. Also I do not own the DTD so changing it to a schema is not an option.
When above code is used, I get «No DTD found.». If I remove «file:///C:/projects/Cllc/SVGWebsite/validationTestHarness/bin/Debug/j2008.dtd» and insert a DOCTYPE in the XML file the parsing works.
If I have both the «file:///C:/projects/Cllc/SVGWebsite/validationTestHarness/bin/Debug/j2008.dtd» and insert the DOCTYPE, I get an error about having two DOCTYPE is invalid.
Any ideas on how to get this to work or why this is not possible?
Answers
-
Hi Jason,
I’ve been working on this problem myself, I used the following code;
Code Snippet
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
settings.ValidationType = ValidationType.DTD;
settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);XmlReader myxmlr;
myxmlr = XmlReader.Create(«BasisOption.xml», settings);try
{
bool result = myxmlr.Read();}
catch (Exception ex)
{
UtilException.DumpException(ex);
}However the key to making this work was the following line in the xml.
<!DOCTYPE root-element SYSTEM «validation.dtd»>
Without this line I too got the very unhelful ‘No DTD found.»
Cheers
Rich
I too am having trouble with stuff in my DTD not being recognized.
I am very new to XML and am just trying to do the exercises in a book.
On the below XML, I get the error «Entity danny-description not defined».
I also tried adding the following line to the catalog file:
<public publicId=»-//Beginning XML//DTD Contact Example//EN» uri=»file:///d:documents%20and%20settings/mzkx19/my%20documents/training/contacts5.dtd»/>
Here is my XML:
<?xml version=»1.0″?>
<!DOCTYPE contacts PUBLIC «-//Beginning XML//DTD Name Example//EN» «D:/Documents%20and%20Settings/mzkx19/My%20Documents/Training/contacts5.dtd»>
<contacts source=»» version=»1.0″>
<contact person=»Jeff_Rafter» tags=»author xml poetry»>
<name>
<first>Jeff</first>
<first>Craig</first>
<last>Rafter</last>
</name>
<location>
<address>Redlands, CA, USA</address>
<latitude>34.031892</latitude>
<longitude>117.207642</longitude>
</location>
<phone kind=»Home»>001-909-555-1212</phone>
<knows contacts=»David_Hunter Danny_Ayers»></knows>
<description>&jeff-description;</description>
</contact>
<contact person=»David_Hunter» tags=»author consultant CGI»>
<name>
<first>David</first>
<last>Hunter</last>
</name>
<location>
<address>&address-unknown;</address>
&empty-gps;
</location>
<phone kind=»Work»>416 555 1212</phone>
<knows contacts=»Jeff_Rafter Danny_Ayers»></knows>
<description>&david-description;</description>
</contact>
<contact person=»Danny_Ayers» tags=»author semantics animals»>
<name>
<first>Daniel</first>
<middle>John</middle>
<last>Ayers</last>
</name>
<location>
<latitude>43.847156</latitude>
<longitude>10.50808</longitude>
<address>Mozanella, 7 Castiglione di Garfagnana, 55033 Lucca Italy</address>
</location>
<phone>+39-0555-11-22-33-</phone>
<knows contacts=»Jeff_Rafter David_Hunter»></knows>
&danny-description;
</contact>
</contacts>
Here is my DTD:
<!ELEMENT contacts (contact*)>
<!ATTLIST contacts version CDATA #FIXED «1.0»>
<!ATTLIST contacts source CDATA #IMPLIED>
<!ELEMENT contact (name, location, phone, knows, description)>
<!ELEMENT name (first+, middle?, last)>
<!ATTLIST contact person ID #REQUIRED>
<!ATTLIST contact tags NMTOKENS #IMPLIED>
<!ELEMENT name (first+, middle?, last)>
<!ELEMENT first (#PCDATA)>
<!ELEMENT middle (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ELEMENT location (address | (latitude, longitude))*>
<!ELEMENT address (#PCDATA)>
<!ELEMENT latitude (#PCDATA)>
<!ELEMENT longitude (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ATTLIST phone kind (Home | Work | Cell | Fax) %DefaultPhoneKind;>
<!ELEMENT knows EMPTY>
<!ATTLIST knows contacts IDREFS #IMPLIED>
<!ELEMENT description (#PCDATA | em | strong | br)*>
<!ELEMENT em (#PCDATA)>
<!ELEMENT strong (#PCDATA)>
<!ELEMENT br EMPTY>
<!ENTITY source-text «The source of this contacts list is Beginning XML 4E»>
<!ENTITY address-unknown «The address for this location is "Unknown"»>
<!ENTITY empty-gps «<latitude></latitude><longitude></longitude>»>
<!ENTITY jeff-description PUBLIC
«-//Beginning XML//Jeff Description//EN» «jeff.txt»>
<!ENTITY david-description PUBLIC
«-//Beginning XML//David Description//EN» «david.txt»>
<!ENTITY danny-description PUBLIC
«-//Beginning XML//Danny Description//EN» «danny.txt»>
<!ENTITY % DefaultPhoneKind ‘»Home»‘>
Here are my external files:
jeff.txt:
Jeff is a developer & author for Begining XML <em>4th edition</em> © 2006
Wiley Publishing.<br/>Jeff <strong>loves</strong> XML!
david.txt:
Senior Technical Consultant for CGI
danny.txt:
<description>A Semantic Web developer and technical author specializing in cutting-
edge technologies.</description>
Any help anyone can give would be greatly appreciated.
Thanks,
Jim Shaw
Я пытаюсь использовать xmllint для проверки моей работы при разработке базовой схемы XSD, т. е. схемы XML. Однако это дает мне ошибку
ошибка проверки: DTD не найден.
что я делаю не так?
моя команда xmllint:
xmllint --noout --valid --schema simple.xsd lucas-basic.xml
lucas-basic.xml:5: validity error : Validation failed: no DTD found !
>
^
lucas-basic.xml validates
тестовый файл XSD:
<?xml version = "1.0" encoding = "UTF-8"?>
<!--Generated by XML Authority. Conforms to w3c http://www.w3.org/2001/XMLSchema-->
<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema">
<xsd:element name = "vehicles">
<xsd:complexType>
<xsd:sequence>
<xsd:element name = "nickname" type = "xsd:string" maxOccurs = "unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
тестовый XML-файл:
<?xml version="1.0"?>
<vehicles
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation = "http://lucas.ucs.ed.ac.uk/xml-schema/xmlns/simple.xsd"
>
<nickname>Bog Hopper</nickname>
<nickname>Wee Beastie</nickname>
<nickname>Count Zero</nickname>
</vehicles>
URL в xsi: noNamespaceSchemaLocation возвращает вышеуказанный XSD. Кроме того, я загрузил файл xsd и поместил его в текущий каталог в качестве дополнительной меры, но это, похоже, ничего не изменило.
2 ответов
--valid
для DTDs, не XSDs.
это будет работать для вас, вместо:
xmllint --noout --schema http://lucas.ucs.ed.ac.uk/xml-schema/xmlns/simple.xsd lucas-basic.xml
попытка OP и принятый ответ «проверяют» XSD, проверяя его на примере файла. Для проверки xsd-файла на соответствие спецификации XSD может использоваться следующая команда:
xmllint --noout --schema http://www.w3.org/2001/XMLSchema.xsd my_schema.xsd
… и для v1.1 Схема https://www.w3.org/2009/XMLSchema/XMLSchema.xsd
Примечание: v1.0 schema имеет некоторые квалификации в верхней части схемы нормативной структуры, поэтому возможно, что на самом деле должен использоваться другой файл, но это сработало хорошо для меня.