dtd

Inline DTD with Builder

Hi, How would I create this... <!DOCTYPE root-element[ <!ENTITY % w3centities PUBLIC "-//W3C//ENTITIES Combined Set//EN//XML" "w3centities.ent" > %w3centities; ]> ...using Builder? I can manage everying apart from the "%w3centities;" in the second to last line with the following code: xml.declare! :DOCTYPE, "root-element"...

How to stop Eclipse IDE from trying to download DTDs for validation?

I have a XHTML-file using the following doctype-definition: `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;` Eclipse is trying to validate the file by using the referenced dtd file, which results in this error: ParseException: Error validating the model: Se...

Default value from DTD in xStream.

Geven XML file <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ExternalRequestContext [ <!ELEMENT ExternalRequestContext EMPTY> <!ATTLIST ExternalRequestContext requestType CDATA #REQUIRED deepEnrichment (true | false) "false" channelMandatory (true | false) "true"> ] > <ExternalRequestContext requestType="News" deepEnrichment="fal...

Document type declaration and namespaces

Hi I’m new to XML and am currently learning about Document Type Declaration. Anyways, when declaring elements in the body of DTD, the element name must appear exactly as it will within the XML document, including any namespace prefix, which means users can’t define their own namespace, but must use the prefix defined within DTD. a) I...

libxml2 - validate XML document against schema. Retrieve schema url from the actual XML file.

Hi, I need to validate a xml file against DTD schema. I found out that I need to pass the source of schema file for validation. Is that possible to make libxml2 find the declaration of schema in XML file and do the validation on its own, or do I have to retrieve the declaration manually? Thanks in advance Michal ...

How to load an XHTML file into an XElement using a custom XmlUrlResolver?

I am trying to get an XHTML file loaded into an LINQ XElement. However, I am running into problems with the resolver. The problem has to do with the following definition: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; I have a custom XmlUrlResolver with an o...

Prevent 503 error from W3.org when Spring tries to load XML files

In short, I'm trying to learn a bit of Spring. Problem is, when I deploy my application, Spring loads XML files and encounters this exception: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/spring-servlet.xml] is invalid; nested exception is oracle.xml...

Handle public external DTDs in .Net via XmlResolver

Hi, my XML is referencing a DTD like this: < !DOCTYPE article PUBLIC "-//OWNER//NAME//EN" "http://invalid/path/to.dtd"> The DTD is not available via the given URL, but I can download it to my disc. I tried to implement a custom XmlResolver to load the DTD, but it does not work. My custom XmlResolver implements GetEntity and via the de...

XML DTD - Defining attributes as numbers and requiring #PCDATA

I realize Schema is the way to go, but this is an assignment. If I wanted to require an attribute on some element to be a float/number, is that possible? The only thing I know to do is to define it as CDATA - is there some predefined ENTITY ? I don't think I should pull in any other DTD, so if it's that complex, it's incorrect for the...

Can XML attributes have spaces?

I'm creating a DTD for an xml document. I have an Enumerated attribute for an xml element. My question is: Can the attribute Type have spaces? eg: <!ELEMENT Link (#PCDATA)> <!ATTLIST Link Type (Amendment|Reference|Superseded|Modified| Corrigendum|Corresponds|Endorsement|Equivalent|Identical|Modified| Not Equivalent|Note take...

Full Example XHTML document showing how to define additional attributes

I am trying to extend an xhtml document to allow extra attributes. In the w3.org it gives an example like so: <!ATTLIST a myattr CDATA #IMPLIED > See: 6.1. Defining additional attributes - http://www.w3.org/TR/1999/xhtml-modularization-19990406/developing.html#s_dev_attrs However i am not sure where to put that statemen...

JiBX binding DTD schema in Eclipse

I have warnings in binding xml files: No grammar constraints (DTD or XML schema) detected for the document. I have done as is written in the answer here: http://stackoverflow.com/questions/982263/jibx-how-do-i-keep-using-interfaces-in-my-code (answer which is not accepted). But now I have an error in binding xml file: Referenced file...

php script to convert xml to dtd

Hi all, Is there any PHP script to convert XML file to DTD. I tried a lot. I can able to find tools but can't PHP script. Is there any? any help will be thankful... Fero ...

DTD with RFDa and XHTML 1.0 Transitional support

Is there a W3C document type available with both XHTML 1.0 transitional support and RDFa support? I am aware of the XHTML+RDFa 1.0 (http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd) DTD but that is XHTML 1.1 which is not compatible with my current website. It seems that there is also a HTML4+RDFa 1.0 (http://www.w3.org/MarkUp/DTD/html4-rdf...

Set a DTD using minidom in python.

I am trying to include a reference to a DTD in my XML doc using minidom. I am creating the document like: doc = Document() foo = doc.createElement('foo') doc.appendChild(foo) doc.toxml() This gives me: <?xml version="1.0" ?> <foo/> I need to get something like: <?xml version="1.0" ?> <!DOCTYPE something SYSTEM "http://www.path.t...

Looking for a DTD diff tool / is a given DTD a subset of another

I need to verify that a "simplified" DTD is really a subset of a larger DTD, i.e. that documents that are valid according to the "simplified" DTD will also always be valid according to the larger (or "master") DTD. The simplified DTD is being written now -- it's derived from the master DTD (were it the other way around, one could simply...

Writing a DTD: How to achieve this children setup

The element tasklist may contain at most one title and at most one description, additionally any number (incl. 0) task elements in any order. The naive approach is not applicable, since the order should not matter: <!ELEMENT tasklist (title?, description?, task*) > Alternatively, I could explicitly name all possible options: (title,...

dtd vs xsd, which one to choose?

i want to use one of these to describe my xml document. i've read that xsd is better than the older dtd since it supports namespaces and data types. does this mean that i should only use xsd for all future needs and totally ignore dtd and don´t even have to bother learning its structure? ...

How can I force a SAX parser to use a DTD if one is not specified in the input file?

How can I force a SAX parser (specifically, Xerces in Java) to use a DTD when parsing a document without having any doctype in the input document? Is this even possible? Here are some more details of my scenario: We have a bunch of XML documents that conform to the same DTD that are generated by multiple different systems (none of whi...

Parsing XML in C from a DTD and building a linked-list accordingly...

I'm trying to parse an XML file using C. The DTD for this XML file is fairly simple. It's basically a bunch of key-value pairs, with support for arrays as well. I've found XML parsers like Mini-XML and AsmXml, but they don't seem to support building a linked-list of the XML file based on the DTD. Is there an XML parsing library availab...