dtd

The markup declarations contained or pointed to by the document type declaration must be well-formed

 ̄綄美尐妖づ 提交于 2020-01-02 08:24:31
问题 I have written one XML, but in that XMLon very first line I am getting an error The markup declarations contained or pointed to by the document type declaration must be well-formed below is that XML (space after angular brackets is intentional) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apche.org/dtds/struts-2.0.dtd"> <struts> <package name="default" extends="struts-default"> <action name=

Error parsing a DTD using lxml

巧了我就是萌 提交于 2020-01-01 06:54:49
问题 I'm trying to write a validation script that will validate XML against the NITF DTD, http://www.iptc.org/std/NITF/3.4/specification/dtd/nitf-3-4.dtd. Based on this post I came up with the following simple script to validate a NITF XML document. Bellow is the error message I get when the script is run, which isn't very descriptive and makes it hard to debug. Any help is appreciated. #!/usr/bin/env python def main(): from lxml import etree, objectify from StringIO import StringIO f = open('nitf

What is the reason for not allowing non-deterministic element declarations in DTDs and XSD schemas?

狂风中的少年 提交于 2019-12-31 03:18:08
问题 The following declaration: <!ELEMENT p ((b, a) | (b, c))> and its XSD equivalent are both invalid because they are not deterministic, according to validators and a quick check of the spec(s). However, since every non-deterministic finite automaton has an equivalent deterministic finite automaton and since there are algorithms for converting NFAs into DFAs, what is the reason for prohibiting non-deterministic declarations? 回答1: There are two classes of possible answer to a question like this:

Validation of an xml document using a dtd document

你离开我真会死。 提交于 2019-12-31 03:12:10
问题 I'm new to XML. I'm confused how a DTD document validates an XML document. Below is my code and please correct me if I am wrong. <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE note [ <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> ]> <note> <to>Tove</to> <rom>Jani</rom> // Here i've miss-spelled the tag <from> but still not getting error <heading>Reminder</heading> <body>Don't forget me this

HTML DTDs - what's the point? [duplicate]

拜拜、爱过 提交于 2019-12-30 09:53:21
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: What are the different doctypes in html and what do they mean? Being fairly inexperienced with certain aspects of web development (I've always concentrated more on the back-end than the front), can anyone give me their thoughts on whether I should worry about the DOCTYPE declaration made at the beginning of web pages? Is the most common HTML 4.01 and should I build my web apps to conform to this standard? 回答1:

Using Python and lxml to validate XML against an external DTD

点点圈 提交于 2019-12-30 07:29:07
问题 I'm trying to validate an XML file against an external DTD referenced in the doctype tag. Specifically: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd"> ...the rest of the document... I'm using Python 3.3 and the lxml module. From reading http://lxml.de/validation.html#validation-at-parse-time, I've thrown this together: enexFile = open(sys.argv[2], mode="rb") # sys.argv[2] is the path to an XML file in local storage.

Using Python and lxml to validate XML against an external DTD

邮差的信 提交于 2019-12-30 07:29:07
问题 I'm trying to validate an XML file against an external DTD referenced in the doctype tag. Specifically: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd"> ...the rest of the document... I'm using Python 3.3 and the lxml module. From reading http://lxml.de/validation.html#validation-at-parse-time, I've thrown this together: enexFile = open(sys.argv[2], mode="rb") # sys.argv[2] is the path to an XML file in local storage.

How to define DTD without strict element order?

我的未来我决定 提交于 2019-12-29 06:48:30
问题 As an XML "noob" I have discovered the importance of element order when creating an XML stream/file that is validated against a DTD. Is it possible to define a DTD that is not order dependent on elements ? If, so please provide syntactic example. 回答1: You use or (a vertical pipe) and repeat (an asterisk:) <!ELEMENT eltype1 ( eltype2 | eltype3)*> This means eltype1 can contain any number of repetitions of eltype2 or eltype3 . 回答2: The only issue with the currently accepted answer is that it

Generate Java classes with JAXB from a DTD file - how can I modify the DTD?

送分小仙女□ 提交于 2019-12-29 06:29:27
问题 I want to generate Java classes from a dtd file using JAXB. The dtd looks like this: <!--Contents--> <!ELEMENT persons (header, content) > <!ELEMENT groups (header, content) > <!--Header--> <!ELEMENT header (version) > <!ELEMENT version(#PCDATA) > <!--Content--> <!ELEMENT content(person, group)* > <!--Person--> <!ELEMENT person(p_id, p_name) > <!ELEMENT p_id (#PCDATA) > <!ELEMENT p_name (#PCDATA) > <!--Group--> <!ELEMENT group(g_id) > <!ELEMENT g_id(#PCDATA) > When generating the classes with

why hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net occur?

强颜欢笑 提交于 2019-12-25 01:10:04
问题 org.dom4j.DocumentException: hibernate.sourceforge.net Nested exception: hibernate.sourceforge.net java.net.UnknownHostException: hibernate.sourceforge.net I'm getting these errors above shown in hibernate and when internet is on then it will work fine. If no internet it will show the above error. Please help me thanks in advance. Please give brief and clear explanation. 回答1: It seems like your DOCTYPE definition in one of your XML files refers to a DTD that is on hibernate.sourceforge.net.