dtd

XML and DTD: The content of element type must match

不羁的心 提交于 2020-01-30 08:58:05
问题 I'm learning XML at the moment and I'm struggling with the first DTD extension. My DTD : <!ELEMENT biblio (livre*) > <!ELEMENT livre (achat , auteurs, titre ) > <!ATTLIST livre langue CDATA #IMPLIED ref CDATA #IMPLIED> <!ELEMENT achat EMPTY > <!ATTLIST achat date CDATA #IMPLIED lieu CDATA #IMPLIED> <!ELEMENT titre (#PCDATA)> <!ATTLIST titre genre CDATA #IMPLIED type NMTOKEN #IMPLIED> <!ELEMENT auteurs (auteur+) > <!ELEMENT auteur ( nom?, prenom? ,sexe?) > <!ELEMENT nom (#PCDATA)> <!ELEMENT

XML Invalid DTD error

丶灬走出姿态 提交于 2020-01-24 14:16:07
问题 . Validate Online: http://xmlvalidator.new-studio.org XML Document (also displayed below) Question 1 When I uncomment the following line no. 4 <!ELEMENT persona (#PCDATA|(name,dob?,address*)) > AND comment the following line no. 5 <!ELEMENT persona (name,dob?,address*) > Why the following error shows? Line 4 Column 28 : An element type is required in the declaration of element type "persona". Here, I want that user can EITHER use parsable character string OR can write the name, dob & address

How to ignore inline DTD when parsing XML file in Java

北慕城南 提交于 2020-01-23 08:05:26
问题 I have a problem reading a XML file with DTD declaration inside (external declaration is solved). I'm using SAX method (javax.xml.parsers.SAXParser). When there is no DTD definition parsing looks like for example StartEement-Characters-StartElement-Characters-EndElement-Characters...... So there is characters method called immediately after Start or End element and thats how I need it to be. When DTD is in file parsing schema changes to for example StartElement-StartElement-StartElement

In DTDs, why are namespaces given as a URL?

半世苍凉 提交于 2020-01-20 08:30:50
问题 Apparently, the namespace URL that follows xmlns in HMTL and XML pages are meaningless. And all this time I though there actually were namespaces at those addresses... When I first read/heard about namespaces, I imagined there some large files at the URLs provided that contained a list of all the valid 'names' that could be used in instances of the document. I've come to learn I imagined wrong. But if the URL is totally useless, what exactly is the point of a namespace? How do you know if

In DTDs, why are namespaces given as a URL?

送分小仙女□ 提交于 2020-01-20 08:30:13
问题 Apparently, the namespace URL that follows xmlns in HMTL and XML pages are meaningless. And all this time I though there actually were namespaces at those addresses... When I first read/heard about namespaces, I imagined there some large files at the URLs provided that contained a list of all the valid 'names' that could be used in instances of the document. I've come to learn I imagined wrong. But if the URL is totally useless, what exactly is the point of a namespace? How do you know if

Errors when validating XML and DTD

巧了我就是萌 提交于 2020-01-17 04:15:08
问题 I'm working on a XML file and I'm having issues with it. Here's the DTD : <!ELEMENT book (bookinfo,chapter*)> <!ELEMENT chapter (title,section*)> <!ELEMENT title (#PCDATA)> <!ELEMENT bookinfo (title,author,copyright)> <!ELEMENT author (firstname,surname)> <!ELEMENT copyright (year,holder)> <!ENTITY % divers "para|programlisting|itemizedlist|orderedlist"> <!ELEMENT section (title,(%divers;)+)> <!ELEMENT para (#PCDATA)> <!ELEMENT programlisting (#PCDATA)> <!ELEMENT holder (#PCDATA)> <!ELEMENT

Is there a DTD for XPage source?

北城余情 提交于 2020-01-16 00:59:09
问题 With whatever little knowledge I have of XML I know that we can associate a DTD with XML file which defines all the valid elements, its attributes and where they can appear. Is there any such DTD associated with XPage source code defining all the elements and its attributes? Where does it define tags like xp:view , xp:panel , xp:button and so on along with its associated properties? So I am looking for a file with content something like <!ELEMENT xp:panel ......> 回答1: No There is not a DTD

XML Reader wants ProhibitDTD to be false but it is!

ε祈祈猫儿з 提交于 2020-01-14 03:47:10
问题 Here is the code Stream stream = request.InputStream; String xsd = // Path to file XmlReaderSettings settings = new XmlReaderSettings(); if (xsd.Length != 0 && File.Exists(xsd)) { settings.ProhibitDtd = false; settings.Schemas.Add("", xsd); settings.ValidationType = ValidationType.Schema; } else { throw new cXMLException("XSD file not found", ResponseStatus.InternalServerError); } using (XmlReader reader = XmlReader.Create(stream, settings)) { XmlDocument doc = new XmlDocument(); // Attempt

Concise way of defining your own YAML syntax?

我与影子孤独终老i 提交于 2020-01-14 03:45:06
问题 For XML, there are Document Type Definitions (DTD) which define all elements, but is there something similar for YAML? I found a post on Validating YAML with an XML DTD which suggests to use DTDs anyhow and/or a simple XML, but I am doubtful whether that is feasible in my case: My project decided to have a (custom) YAML format. From a YAML file in this format a rather intricate XML is algorithmically generated. The YAML contains much less information than the XML, but all significant things a

Validating YAML with an XML DTD

蹲街弑〆低调 提交于 2020-01-13 18:10:54
问题 I work with a tremendous volume of legacy code on system that requires people of all sorts from other departments with little or no technical experience to have to learn XML (and a rather elaborate set of DTDs) for the digitizing of documents, which then get passed on to some specialized devices designed specifically to use the XML. It occurred to me that YAML or JSON (or something else I haven't heard of at all?) might be far easier on the human authoring end for people who really don't know