dtd

Swing GUI generator for XML

My application has an XML configuration file which users now edit in a text editor. I want to provide a (Swing) form for editing this configuration. I have a DTD for the XML, but the application does not accept all XML documents validated by the DTD i.e. the application imposes more restrictions than those in the DTD. I was about to sta...

DTD -> XSD conversion: mixed list of two elements, one constrained

Hi, I'm trying to represent the following DTD fragment in XSD:- (A | B)* | (A | C)* | (A | D)* | ... i.e. a mixed list of any number of As and any number of one of B, C, D, ... CastorConverter spits out:- <choice> <choice minOccurs="0" maxOccurs="unbounded"> <element ref="t...

Is Scala/Java not respecting w3 "excess dtd traffic" specs?

I'm new to Scala, so I may be off base on this, I want to know if the problem is my code. Given the Scala file httpparse, simplified to: object Http { import java.io.InputStream; import java.net.URL; def request(urlString:String): (Boolean, InputStream) = try { val url = new URL(urlString) val body = ur...

Validate an XML file against local DTD file with Java

How can I validate an XML file against a DTD that is stored locally as a file? The XML file does not have any DOCTYPE declaration (or may have one that should then be overridden). I had a look at this thread but besides the fact they are using .NET I doubt that this is a good solution. Any input appreciated! ...

Survey: how are you using ID/IDREF? (or key/keyref)

I'm interested in how people use this feature: what domain, what relationships (apologies if survey questions aren't appropriate). XML represents trees naturally using containment; but it can also represent graphs, using IDREFs that refer to IDs: many elements can refer to the same element (multi-ref); and a nested element can refer to ...

xml parsing problem with c# linq to xml - Reference to undeclared entity

tryin to parse an xml file gives me the following error Reference to undeclared entity 'eacute' after I created a dtd file with all the entities that I found here http://www.w3.org/TR/xhtml1/dtds.html and I loaded it as follows XmlReaderSettings settings = new XmlReaderSettings(); settings.ProhibitDtd = false; string s = System.IO.Fi...

XmlReader DTD Validation Error on an Attribute

I am trying to use XmlReader to parse a file and set each element's attributes to variables using reader.GetAttribute("atrribute_name"), but the elements may or may not actually have that attribute present, so some elements give me an error...I would have expected it would just return null when the attribute is not present, but instead i...

How will a browser differentiate between XHTML 1.0 and XHTML 5?

By my understanding, neither XHTML (1.0, 1.1) nor XHTML 5 required a DTD. If this is true, how will a browser differentiate between the two? I can only assume that when the browser vendors support (X)HTML 5, all XHTML will be interpreted under XHTML 5 rules (assuming XHTML 5 is a superset of XHTML 1.0). Is this how it's going to work? ...

DTD ATTLIST Range of Numbers

Hi is it possible to only allow a range of numbers in an ATTLIST? I know you can have an enumeration of a set as follows: But it is possible to have 0 - 100, without having to type all 100 numbers? Thank you. ...

XML validation with an external DTD in Java

How can I test an xml string to see if it validates against and dtd file? I've read this question but they only see to be talking about replacing the dtd declaration on an xml file. Person.DTD <?xml version="1.0" encoding="UTF-8"?> <!ELEMENT person (id)> <!ELEMENT id (#PCDATA)> Test @Test public void should_serialize_a_shootout_to...

DTD Entities vs XML-Schema Elements

Hi, using an in Document DTD I did the following: file.xsl: <!DOCTYPE xsl:stylesheet[ <!ENTITY red "rgb(255,0,0)"> ]> <xsl:stylesheet> [...] <xsl:attribute name="color">&red;</xsl:attribute> [...] </xsl:stylesheet> I wanted to change everything to XML-Schema. So I tried: file.xsd: <xsd:schema xmlns:xsd="http://www.w3.o...

WebLogic XML External Entity Resolution: Is there another way besides using the XML Registry?

We have an application that uses SiteMesh, and when WebLogic tries to parse the TLD files, it sees the DOCTYPE specification, containing the reference to the TLD DTD, at "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd". The server can not initiate outbound connections to the Internet, and so cannot retrieve the DTD, which causes the ...

Validating XML in Python without non-python dependencies

I'm writing a small Python app for distribution. I need to include simple XML validation (it's a debugging tool), but I want to avoid any dependencies on compiled C libraries such as lxml or pyxml as those will make the resulting app much harder to distribute. I can't find anything that seems to fit the bill - for DTDs, Relax NG or XML S...

Element Declaration: Defining content as #PCDATA and one occurence of child element

In the xml spec, it says: [Definition: An element type has mixed content when elements of that type may contain character data, optionally interspersed with child elements.] In this case, the types of the child elements may be constrained, but not their order or their number of occurrences Is there any way to work around this to make t...

XML validation against given DTD in PHP

In PHP, I am trying to validate an XML document using a DTD specified by my application - not by the externally fetched XML document. The validate method in the DOMDocument class seems to only validate using the DTD specified by the XML document itself, so this will not work. Can this be done, and how, or do I have to translate my DTD t...

Strict xml validation in php

I'm trying to fully validate an xml file which may be published by a user before it's fully published and live - it's basically somewhat like a sitemap.xml and it absolutely can't be published without being error-proof ( yes, I do have my own custom dtd for it as well ). I was also thinking of implementing a storage system so it would s...

Java 5 Does not validate DTD

I am working with a vendor applet, The applet works fine with JRE 1.4.2_X and 1.6.X but fails on every version of 1.5.X. Running with 1.6 is not an option due to another application conflict that does not play nice with Java 6. The issue I believe is that the DTD is not being validated. This is causing the "not declared" problem and the...

Is there a class built-in to .NET for querying XML DTD information?

Does .NET provide any built-in support for working with XML DTDs? I want to retrieve element type, attribute lists, and entity declaration information. I'm aware of the support for validating against a DTD, but want to be able to work with the DTD information itself. I'd be fine parsing DTDs manually to accomplish this, but would rather...

Is this a valid XML?

I have a feeling this XML is not valid, can someone please explain why? I think it has something todo this the dot i the element name? estate_price.price_suggestion Any thing else not valid about this XML? XML \\ <?xml version="1.0" encoding="UTF-8"?> <iad> <DataTag> <element id="0"> <changed_string>content</changed_st...

How can produce a DOCTYPE declaration with DOM level 3 serialization API?

I have a DOM Document created from scratch and I need to serialize it to an output stream. I am using DOM level 3 serialization API, like in the following example: OutputStream out; Document doc; DOMImplementationLS domImplementation = (DOMImplementationLS) DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplement...