dtd

xml dtd- how to avoid parsing the content of an element?

Among the elements that consist my xml, I have got element let's call it 'X' that can contain many different kind of inner elements. Therefore I'd like to define the DTD parser to avoid parsing its content during its XMl validation. I tried to define this elemtn by: <!ELEMENT X ANY> and got error message that the inner element inside ...

Validate DITA in php

What php library should I use if I want to get the allowable attributes in a tag, or the allowable tags in a specific part of a DITA XML document, according to it's DTD or XSD? I've tried it with the XML_DTD-0.5.2 pear lib, but it seems it parses the offical 1.1 and 1.2 DITA dtds with many errors... ...

Unable to parse JavaHelp's toc.xml

I wrote an XML parser for JavaHelp's toc.xml file in order to intercept some attributes I use in the tocitem tag that are ignored by JavaHelp. Here's what toc.xml looks like: <?xml version='1.0' encoding='ISO-8859-1' ?> <!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 2.0//EN" "http://java.sun.com/produ...

Force DTD ignore when using WCF REST Starter Kit ReadAsXmlSerializable?

I'm using the WCF Rest Starter Kit, and I'm able to send and receive data. I'm trying to serialize the data I receive from the service, but for whatever reason, the XML reponse from the service includes (what I'm guessing is) an invalid DTD. For example: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE response> <response> // blah blah...

Groovy XMLSlurper issue

I want to parse with XmlSlurper a HTML document which I read using HTTPBuilder. Initialy I tried to do it this way: def response = http.get(path: "index.php", contentType: TEXT) def slurper = new XmlSlurper() def xml = slurper.parse(response) But it produces an exception: java.io.IOException: Server returned HTTP response code: 503 ...

Python xml etree DTD from a StringIO source?

I'm adapting the following code (created via advice in this question), that took an XML file and it's DTD and converted them to a different format. For this problem only the loading section is important: xmldoc = open(filename) parser = etree.XMLParser(dtd_validation=True, load_dtd=True) tree = etree.parse(xmldoc, parser) This wo...

Is there a way to show video using video tag in a HTML page with XHTML Mobile Profile?

I have an html with following DTD declaration.<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> I want to use video inside this page. Is there any workaround? I cannot change DOCTYPE. ...

Validating XML with DTD fails to import entity using lxml

I have a tool producing NewsML type XML files and I want to validate them after producing the files. I'm receiving an error: Attempt to load network entity http://www.w3.org/TR/ruby/xhtml-ruby-1.mod The python call is: parser = etree.XMLParser(load_dtd=True, dtd_validation=True) treeObject = etree.parse(f, parser) First I'm not sure...

Ignore DOCTYPE .dtd, but .dtd file must still exist

I have a web service that processes an HTTP request. The document it receives has an embeded DOCTYPE that specifies a .dtd file. I wish to use a newer XML schema validation file made for when newer devices connect to my service. I can successfully ignore the validation that goes on in the .dtd file, but the .dtd file must exist on my l...

Where can I browse common schemas?

It is hackish and myopic to write a new XML schema for a common data situation without considering existing standard schemas. It would be silly, for instance, to write a schema for recording internet bookmarks without considering XBEL. Yet while a quick search yeilds hundreds of examples of how to write your own DTD, RNC, XSD, etc, I h...

Where to put DTD in gzipped files?

I'm adding the following: <?php ob_start( 'ob_gzhandler' ); ?> To a file to enable gzip compression. Should it go before the DTD, or between it and the <html> tag? ...

Do I need to declare content type/charset in both HTML and PHP?

If the content type and character set are declared in the PHP header, is there a reason to have them again in the usual HTML DTD? <?php ob_start( 'ob_gzhandler' ); header('Content-type: text/html; charset=utf-8'); ?> // here <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transiti...

How to load DTDs from a jar file?

The intended machine doesn't have a connection to the internet and I do not want to load it using a fixed location. Aim: To load DTDs from a jar, the jar will be a dependency. ...

DTD: How to declare a DTD to must have a element value ?

Hi, I want to declare my DTD to force the XML node should have a value. For example I have the following XML structure. <Employees> <EmployeeID></EmployeeID> <EmployeeName></EmployeeName> <EmployeeAddress></EmployeeAddress> </Employees> I want the EmployeeID node value must exist for all the XMLs. So I want to create a DTD t...

Where is the HTML5 Document Type Definition?

The "old" HTML/XHTML standards have a DTD (Document Type Definition) defined for them: HTML 4.01 http://www.w3.org/TR/html401/sgml/dtd.html XHTML 1.0 http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Strict This DTDs specify the rules for nesting elements - "which types of elements may appear in which types of elements". I made a...

Yet another question regarding the html5 dtd/schema

If there is no DTD or schema to validate the H5 document against, how are we supposed to do document validation? And by document validation, I mean "how are we supposed to ensure our html5 documents are both syntactically accurate and structurally sound?" Please help! This is going to become a huge problem for our industry if we have no ...