Search Results

Search found 1079 results on 44 pages for 'dtd'.

Page 1/44 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why is the XML DTD not found by the browser

    - by hyperuser
    When I load my XML file in a browser, it complains there is 'no style information': "This XML file does not appear to have any style information associated with it. The document tree is shown below." So I wrote an external DTD, then an internal DTD, but keep getting the same 'no style information' error. It doesn't even show the DTD! What am I doing wrong? <?xml version="1.0"?> <!DOCTYPE fotos [ <!ELEMENT fotos (titel,auteur)> <!ELEMENT titel (#PCDATA)> <!ELEMENT auteur (#PCDATA)> ]> <fotos> <titel>titel1</titel> <auteur>jan</auteur> </fotos>

    Read the article

  • Loading not-so-well-formed XML into XDocument (multiple DTD)

    - by Gart
    I have got a problem handling data which is almost well-formed XHTML document except for it has multiple DTD declarations in the beginning: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ... </head> <body> ... </body> </html> I need load this data into XDocument object using only the first DTD and ignoring the rest declarations. It is not possible to completely ignore DTD processing because the document may have unusual characters like &acirc; or &euro; etc. The text is retrieved from external source and I have no idea why it comes like this. Obviously my naive attempt to load this document fails with System.Xml.XmlException : Cannot have multiple DTDs: var xmlReaderSettings = new XmlReaderSettings { DtdProcessing = DtdProcessing.Parse XmlResolver = new XmlPreloadedResolver(), ConformanceLevel = ConformanceLevel.Document, }; using (var xmlReader = XmlReader.Create(stream, xmlReaderSettings)) { return XDocument.Load(xmlReader); } What would be the best way to handle this kind of data?

    Read the article

  • An error has occurred opening extern DTD (w3.org, xhtml1-transitional.dtd). 503 Server Unavailable

    - by Cheeso
    I'm trying to do xpath queries over an xhtml document. The document looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> .... </head> <body> ... </body> </html> Because the document includes various char entities (&nbsp; and so on), I need to use the DTD, in order to load it with an XmlReader. So my code looks like this: var reader = XmlReader.Create(sr, new XmlReaderSettings { ProhibitDtd = false }); But when I run this, it returns An error has occurred while opening external DTD 'http://www.w3.org/TR/xhtml1-transitional.dtd': The remote server returned an error: (503) Server Unavailable. Now, I know why I am getting the 503 error. W3C explained it very clearly. But I still want to validate the document. How can I validate with the DTD, and get the entity definitions, without hitting the w3.org website? related: - java.io.IOException: Server returned HTTP response code: 503

    Read the article

  • XML Catalog file failing to resolve

    - by newt
    I'm using an OASIS v 1.1 compatible resolver (Norm Walsh's XMLResolver in conjunction with the catalog below. However, I'm pretty sure I've made some sort of obvious error here (this is the first time I've needed to use v 1.1 features) since attempting to resolve OxChapML.dtd fails. Can anyone see something obviously wrong with this? Or even subtly wrong? <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <group xml:base="file:///Volumes/Ac-EDP/DTG/SP%20DTD%20management/OUP_DTD/"> <public publicId="-//OXFORD//DTD OXCHAPML//EN" uri="OxChapML.dtd"/> <public publicId="-//OXFORD//DTD OXENCYCLML//EN" uri="xEncyclML.dtd"/> <public publicId="-//OXFORD//DTD OXLAWML//EN" uri="OxLawML.dtd"/> <public publicId="-//OXFORD//DTD OXSTRUCTML//EN" uri="OxStructML.dtd"/> <public publicId="-//OXFORD//DTD OXLAWREPML//EN" uri="OxLawRepML.dtd"/> <public publicId="-//OXFORD//DTD OXBILINGML//EN" uri="OxBilingML.dtd"/> <public publicId="-//OXFORD//DTD OXMONOLINGML//EN" uri="OxMonolingML.dtd"/> <public publicId="-//OXFORD//DTD TIMELINES//EN" uri="timelines.dtd"/> <systemSuffix OxChapML.dtd" systemIdSuffix="OxChapML.dtd"/> <systemSuffix uri="xEncyclML.dtd" systemIdSuffix="xEncyclML.dtd"/> <systemSuffix systemIdSuffix="OxLawML.dtd" uri="OxLawML.dtd"/> <systemSuffix systemIdSuffix="OxStructML.dtd" uri="OxStructML.dtd"/> <systemSuffix systemIdSuffix="OxLawRepML.dtd" uri="OxLawRepML.dtd"/> <systemSuffix systemIdSuffix="OxBilingML.dtd" uri="OxBilingML.dtd"/> <systemSuffix systemIdSuffix="OxMonolingML.dtd" uri="OxMonolingML.dtd"/> <systemSuffix systemIdSuffix="timelines.dtd" uri="timelines.dtd"/> </group> </catalog>

    Read the article

  • How to validate xml using a .dtd via a proxy and NOT using system.net.defaultproxy

    - by Lanceomagnifico
    Hi, Someone else has already asked a somewhat similar question: http://stackoverflow.com/questions/1888887/validate-an-xml-file-against-a-dtd-with-a-proxy-c-2-0/2766197#2766197 Here's my problem: We have a website application that needs to use both internal and external resources. We have a bunch of internal webservices. Requests to the CANNOT go through the proxy. If we try to, we get 404 errors since the proxy DNS doesn't know about our internal webservice domains. We generate a few xml files that have to be valid. I'd like to use the provided dtd documents to validate the xml. The dtd urls are outside our network and MUST go through the proxy. Is there any way to validate via dtd through a proxy without using system.net.defaultproxy? If we use defaultproxy, the internal webservices are busted, but the dtd validation works.# Here is what I'm doing to validate the xml right now: public static XDocument ValidateXmlUsingDtd(string xml) { var xrSettings = new XmlReaderSettings { ValidationType = ValidationType.DTD, ProhibitDtd = false }; var sr = new StringReader(xml.Trim()); XmlReader xRead = XmlReader.Create(sr, xrSettings); return XDocument.Load(xRead); } Ideally, there would be some way to assign a proxy to the XmlReader much like you can assign a proxy to the HttpWebRequest object. Or perhaps there is a way to programatically turn defaultproxy on or off? So that I can just turn it on for the call to Load the Xdocument, then turn it off again? FYI - I'm open to ideas on how to tackle this - note that the proxy is located in another domain, and they don't want to have to set up a dns lookup to our dns server for our internal webservice addresses. Cheers, Lance

    Read the article

  • JiBX binding DTD schema in Eclipse

    - by Trick
    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 contains errors (file:/C:/Amplio/LiveCliq/Work/core/src/main/resources/config/rest/ mappings/binding.dtd). For more information, right click on the message in the Problems View and select "Show Details..." And the details are: The markup in the document preceding the root element must be well-formed. line 20 I am not familiar with DTD schemas, so I don't know what is the problem. Did anybody found the solution? And - I do not want to turn off validation in XML files, I would like to have this in binding files (mainly for code assist and validation).

    Read the article

  • dtd vs xsd, which one to choose?

    - by noname
    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?

    Read the article

  • valid children of XmlNode according to DTD?

    - by redoced
    consider this: I'm inside a (selfbuilt) XML Editor and am about to add a Child to an XmlNode. How do I know which types of children are valid according to a DTD. it's a behaviour like Intellisense. I couldn't find any .NET classes for "parsing" the DTD. How would i go about this?

    Read the article

  • What options to parse a DTD using PHP

    - by Chadwick
    I need to parse DTDs using PHP and am hoping there's a simple library to help out. Each DTD has numerous <!ENTITY... and <!-- Comment... elements, which I need to act upon. Note that I do not need to validate anything against these DTDs, simply parse them as data files themselves. A few options I've looked at: James Clarke's SD, which is an option of last resort, but I'd like to avoid the complexity of building/installing/configuring code external to PHP. I'm not sure it's even possible in my situation. PEAR has an XML_DTD_Parser, which requires installing/configuring PEAR and a number of pear modules, which I'm also not sure is possible, and would rather avoid. Has anyone used it with success? PHP XML Classes has the class_path_parser, which another site suggested, but it fails to read ENTITY elements. It appears to be using PHP's built in XML parsing capabilities, which use EXPAT. PHP's DOMDocument will validate against a DTD, so must be able to read them, though I don't see how to get at the DTD parser directly at first glance.

    Read the article

  • What libraries will parse a DTD using PHP

    - by Chadwick
    I need to parse DTDs using PHP and am hoping there's a simple library to help out. Each DTD has numerous <!ENTITY... and <!-- Comment... elements, which I need to act upon. Note that I do not need to validate anything against these DTDs, simply parse them as data files themselves. A few options I've looked at: James Clarke's SD, which is an option of last resort, but I'd like to avoid the complexity of building/installing/configuring code external to PHP. I'm not sure it's even possible in my situation. PEAR has an XML_DTD_Parser, which requires installing/configuring PEAR and a number of pear modules, which I'm also not sure is possible, and would rather avoid. Has anyone used it with success? PHP XML Classes has the class_path_parser, which another site suggested, but it fails to read ENTITY elements. It appears to be using PHP's built in XML parsing capabilities, which use EXPAT. PHP's DOMDocument will validate against a DTD, so must be able to read them, though I don't see how to get at the DTD parser directly at first glance.

    Read the article

  • getting expat to use .dtd for entity replacement in python

    - by nicolas78
    I'm trying to read in an xml file which looks like this <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE dblp SYSTEM "dblp.dtd"> <dblp> <incollection> <author>Jos&eacute; A. Blakeley</author> </incollection> </dblp> The point that creates the problem looks is the Jos&eacute; A. Blakeley part: The parser calls its character handler twice, once with "Jos", once with " A. Blakeley". Now I understand this may be the correct behaviour if it doesn't know the eacute entity. However, this is defined in the dblp.dtd, which I have. I don't seem to be able to convince expat to use this file, though. All I can say is p = xml.parsers.expat.ParserCreate() # tried with and without following line p.SetParamEntityParsing(xml.parsers.expat.XML_PARAM_ENTITY_PARSING_ALWAYS) p.UseForeignDTD(True) f = open(dblp_file, "r") p.ParseFile(f) but expat still doesn't recognize my entity. Why is there no way to tell expat which DTD to use? I've tried putting the file into the same directory as the XML putting the file into the program's working directory replacing the reference in the xml file by an absolute path What am I missing? Thx.

    Read the article

  • Qt C++ XML, validating against a DTD?

    - by Airjoe
    Is there a way to validate an XML file against a DTD with Qt's XML handling? I've tried googling around but can't seem to get a straight answer. If Qt doesn't include support for validating an XML file, what might be the process of implementing validation myself? Any good reference to start with in regards to validating XML against a spec? Thanks for the help!

    Read the article

  • DTD definition error

    - by Geln Yang
    Hi, It will get a error to define a dtd as follow: <!ELEMENT line (property*)> <!ATTLIST line showType (1|?|+|*) "1" > The error: The name token is required in the enumerated type list for the "showType" attribute declaration. It seems the value can't be special characters,such as "?","+","*". To change the characters to Latin-1 characters, like "& #42;"(add a blank before '#') , get the same error. How to resolve this problem? Thanks!

    Read the article

  • Writing a DTD: How to achieve this children setup

    - by Boldewyn
    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, description?, task*) | (title, task+, description?, task*) | (task+, title, task*, description?, task*) | (description, title?, task*) | (description, task+, title?, task*) | (task+, description, task*, title?, task*) | (task*) but then it's quite easy to write a non-deterministic rule, and furthermore it looks like the direct path to darkest madness. Any ideas, how this could be done more elegantly? And no, an XSD or RelaxNG is no option. I need a plain, old DTD.

    Read the article

  • Extending XHTML

    - by Daniel Schaffer
    I'm playing around with writing a jQuery plugin that uses an attribute to define form validation behavior (yes, I'm aware there's already a validation plugin; this is as much a learning exercise as something I'll be using). Ideally, I'd like to have something like this: Example 1 - input: <input id="name" type="text" v:onvalidate="return this.value.length > 0;" /> Example 2 - wrapper: <div v:onvalidate="return $(this).find('[value]').length > 0;"> <input id="field1" type="text" /> <input id="field2" type="text" /> <input id="field3" type="text" /> </div> Example 3 - predefined: <input id="name" type="text" v:validation="not empty" /> The goal here is to allow my jQuery code to figure out which elements need to be validated (this is already done) and still have the markup be valid XHTML, which is what I'm having a problem with. I'm fairly sure this will require a combination of both DTD and XML Schema, but I'm not really quite sure how exactly to execute. Based on this article, I've created the following DTD: <!ENTITY % XHTML1-formvalidation1 PUBLIC "-//W3C//DTD XHTML 1.1 +FormValidation 1.0//EN" "http://new.dandoes.net/DTD/FormValidation1.dtd" > %XHTML1-formvalidation1; <!ENTITY % Inlspecial.extra "%div.qname; " > <!ENTITY % xhmtl-model.mod SYSTEM "formvalidation-model-1.mod" > <!ENTITY % xhtml11.dtd PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" > %xhtml11.dtd; And here is "formvalidation-model-1": <!ATTLIST %div.qname; %onvalidation CDATA #IMPLIED %XHTML1-formvalidation1.xmlns.extra.attrib; > I've never done DTD before, so I'm not even really exactly sure what I'm doing. When I run my page through the W3 XHTML validator, I get 80+ errors because it's getting duplicate definitions of all the XHTML elements. Am I at least on the right track? Any suggestions? EDIT: I removed this section from my custom DTD, because it turned out that it was actually self-referencing, and the code I got the template from was really for combining two DTDs into one, not appending specific items to one: <!ENTITY % XHTML1-formvalidation1 PUBLIC "-//W3C//DTD XHTML 1.1 +FormValidation 1.0//EN" "http://new.dandoes.net/DTD/FormValidation1.dtd" > %XHTML1-formvalidation1; I also removed this, because it wasn't validating, and didn't seem to be doing anything: <!ENTITY % Inlspecial.extra "%div.qname; " > Additionally, I decided that since I'm only adding a handful of additional items, the separate files model recommended by W3 doesn't really seem that helpful, so I've put everything into the dtd file, the content of which is now this: <!ATTLIST div onvalidate CDATA #IMPLIED> <!ENTITY % xhtml11.dtd PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" > %xhtml11.dtd; So now, I'm not getting any DTD-related validation errors, but the onvalidate attribute still is not valid. Update: I've ditched the DTD and added a schema: http://schema.dandoes.net/FormValidation/1.0.xsd Using v:onvalidate appears to validate in Visual Studio, but the W3C service still doesn't like it. Here's a page where I'm using it so you can look at the source: http://new.dandoes.net/auth And here's the link to the w3c validation result: http://validator.w3.org/check?uri=http://new.dandoes.net/auth&charset=(detect+automatically)&doctype=Inline&group=0 Is this about as close as I'll be able to get with this, or am I still doing something wrong?

    Read the article

  • Prevent DTD download when parsing XML, redux

    - by harpo
    I have a folder full of XHTML files, and a console program to process them. The problem is, it doesn't work when I'm offline, because The remote name could not be resolved: 'www.w3.org' A number of sites, including this one, say to set the XmlResolver to null. That is not not working. I have tried setting the XmlResolver to null every way that I can think of: in the XmlDocument, in XmlTextReader, and in the XmlReaderSettings. I believe that it's just creating a default instance. I have also tried implementing my own XmlResolver, but I don't know what to return for external items. public class NonXmlResolver : XmlUrlResolver { public override object GetEntity( Uri absoluteUri, string role, Type ofObjectToReturn ) { if ( absoluteUri.Scheme == "http" ) throw new Exception("What you talking 'bout, Willis?"); else return base.GetEntity( absoluteUri, role, ofObjectToReturn ); } } The documents do not use any special entities, only pure XML. This is possible, right?

    Read the article

  • basic question with a dtd

    - by voodoomsr
    i need an element with the characteristics <!ELEMENT section ((comment*)|definition|(comment*))> but that is ambiguous, i get the next message in visual studio Multiple definition of element 'comment' causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence. So how can i write correctly that? the correct structure is one definition surrounded by possibles comments elements.

    Read the article

  • What is the use of DTD in HTML

    - by shoaibmohammed
    Hello, Could anyone specify what is the need and use of the Document Type Definition in HTML pages. What is the advantages of it? I searched through the Net and found the results to be little bit confusing. Please someone highlight

    Read the article

  • DTD is prohibited in this XML document -- how to change permissions?

    - by frankadelic
    I am using a 3rd-party .NET component which requires an XML configuration file. I'm am using this in an ASP.NET application. I get an error when configure the XML with the following dtd: <!DOCTYPE prod-config SYSTEM "prod-config.dtd"> The error is as follows: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettings to false and pass the settings into XmlReader.Create method. prod-config.dtd is sitting in the same directory as the XML config file. I don't have access to the component code to modify XmlReaderSettings, ProhibitDtd etc. Is there anotherway I can modify or tag the XML file to permit the DTD to be accessed? (FYI, the component is Oracle Coherence .NET client)

    Read the article

  • Path to XML DTD for DBUnit in multi-module Java/Maven project?

    - by HDave
    I have a multi-module maven project. Within the persist module I have a number of XML files data files that reference a DTD: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE myapp-data SYSTEM "myapp-data.dtd" > <dataset> .....omitted for brevity.... </dataset> The DTD is stored in the same directory with the XML files and even Eclipse reports these XML files as valid. However, when I run the application, the DBUnit FlatXMLDataSet throws a FileNotFound exception because it cannot located the DTD. It is apparently looking for the DTD in the root project directory (e.g. myproject/). I would have expected it to look for the DTD in the same directory as the XML file itself (e.g. myproject/persist/target/test-data). Looking at the DBUnit source code, it has this to say about it "Relative DOCTYPE uri are resolved from the current working dicrectory." What's a good way to fix this?

    Read the article

  • .NET: What is the purpose of the ProhibitDtd property in XmlReaderSettings? Why is DTD a security i

    - by Cheeso
    The documentation says: When set to true, the XmlReader throws an XmlException when any DTD content is encountered. Do not enable DTD processing if you are concerned about Denial of Service issues or if you are dealing with untrusted sources. If you have DTD processing enabled, you can use the XmlSecureResolver to restrict the resources that the XmlReader can access. You can also design your application so that the XML processing is memory and time constrained. For example, configure time-out limits in your ASP.NET application. Can someone please explain the issue? Why would a reader application want to prohibit the retrieval of a DTD? Where is the denial-of-service issue, if it is a reading application? What is the "trust" issue that is mentioned? Thanks

    Read the article

  • Validate an Xml file against a DTD with a proxy. C# 2.0

    - by Chris Dunaway
    I have looked at many examples for validating an XML file against a DTD, but have not found one that allows me to use a proxy. I have a cXml file as follows (abbreviated for display) which I wish to validate: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.018/InvoiceDetail.dtd"> <cXML payloadID="123456" timestamp="2009-12-10T10:05:30-06:00"> <!-- content snipped --> </cXML> I am trying to create a simple C# program to validate the xml against the DTD. I have tried code such as the following but cannot figure out how to get it to use a proxy: private static bool isValid = false; static void Main(string[] args) { try { XmlTextReader r = new XmlTextReader(args[0]); XmlReaderSettings settings = new XmlReaderSettings(); XmlDocument doc = new XmlDocument(); settings.ProhibitDtd = false; settings.ValidationType = ValidationType.DTD; settings.ValidationEventHandler += new ValidationEventHandler(v_ValidationEventHandler); XmlReader validator = XmlReader.Create(r, settings); while (validator.Read()) ; validator.Close(); // Check whether the document is valid or invalid. if (isValid) Console.WriteLine("Document is valid"); else Console.WriteLine("Document is invalid"); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } } static void v_ValidationEventHandler(object sender, ValidationEventArgs e) { isValid = false; Console.WriteLine("Validation event\n" + e.Message); } The exception I receive is System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required. which occurs on the line while (validator.Read()) ; I know I can validate against a DTD locally, but I don't want to change the xml DOCTYPE since that is what the final form needs to be (this app is solely for diagnostic purposes). For more information about the cXML spec, you can go to cxml.org. I appreciate any assistance. Thanks

    Read the article

  • No grammar constraints (DTD or XML schema) detected for the document.

    - by fastcodejava
    I have this dtd : http://fast-code.sourceforge.net/template.dtd But when I include in an xml I get the warning : No grammar constraints (DTD or XML schema) detected for the document. The xml is : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE templates PUBLIC "//UNKNOWN/" "http://fast-code.sourceforge.net/template.dtd"> <templates> <template type="type"> <description>Some</description> <variation></variation> <variation-field></variation-field> <allow-multiple-variation></allow-multiple-variation> <class-pattern></class-pattern> <getter-setter>setter</getter-setter> <allowed-file-extensions>java</allowed-file-extensions> <number-required-classes>1</number-required-classes> <template-body> <![CDATA[ Some Data ]]> </template-body> </template> </templates> Any clue?

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >