I want to specify a version (like 1.0 or 2.0) for my DTD (defined inline). My intention is to make the parser program reject the XML document gracefully if the version is different from what it is looking for.
Related Questions in XML
- Postgres && statement Error in Mybatis Mapper?
- Sorting items after building an XML feed?
- C# XML ModelBinding - ASP.NET Core 8 Web API - required field not found
- How can I create an automatic table of contents in docx without the text being bold?
- Odoo 16 Make Fields Readonly Using XPath
- Using similar tags for different objects in XML
- Android Studio problem like gradle sync project failed and plugin error, version 2023.2.1 Iguana
- error: cannot find symbol View root = inflater.inflate(R.layout.toolbar, parent, false);
- Android camera application restriction to 12 mp
- Azure Data Factory Copy Activity Only Importing First Row of XML file
- I am not able to remove space below the navigation view icon in android studio. What;s wrong with code?
- Field can be converted to a local variable ,convert field to local variable in onCreate method
- Deserialize XML with optional different name
- Retrieve tags from xml using python
- Getting attribute from xml and printing it error
Related Questions in XML-PARSING
- Gradle SAXParseException cvc-complex-type.2.4.a
- XPath - how to exclude text from child node
- Can not extract resource from com.android.aaptcompiler.ParsedResource@124d2e11
- Cannot Access Podcast Category from RSS Feed Using FeedKit due to Missing Member
- How to get all child and sibling data from an XML file and output to a table
- Uncaught Error: Call to a member function registerXPathNamespace() on boolean in
- Dynamically parsing XML in Databricks
- XML namespaces default vs namespace prefix
- XML Parsing in Snowflake with sub nodes
- Parsing an XML with missing content
- Inserting XML tags at specific part of file without disrupting format
- Extracting value of xml in PostgreSQL
- How would a real developer do this?
- XML (TEI document) parsing in R: how can I extract only the head?
- Serializing XML into POCO and then into JSON string
Related Questions in DTD
- Adding a horizontal line in CSS stylesheet (for XML file)
- IIS url rewrite need help in outbound for dtd
- How to autocreate a valid xml structure giving only a dtd DOCTYPE VSCODE
- Is there a way to disregard a referenced dtd when running an xslt?
- How to get internal subset using SAX parser in XercesC?
- Is there a DTD for the DTD?
- The entity &bar; is not defined
- jQuery is not compatible with Quirks Mode - for DTD html 4.0 transitional <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- Why I can't enable DTDs support in T-SQL?
- Create logic within DTD/XML
- mapping relational database schema to document type definition (DTD)
- How to add a Service Reference from wsdl with DTD
- xml schema, multiple elements with same name but with different types error
- How to read doctype declaration of an xml using xslt?
- Is it possible to re-use `("0" | "1")` via a parameter entity in DTD?
Related Questions in DTD-PARSING
- Redefine DTD element
- How to assign XML DTD entity to attribute value
- MS Access ImportXML "DTD not allowed"
- Validate MathML xml string via local MathML DTD
- non-deterministic content model error DTD
- Improper Restriction of XML External Entity Reference
- How to parse DTD node structure with MSXML6
- How to validate xml:lang ATTLIST inside XML with DTD?
- Loading a DTD from text using libxml2 for python
- DTD validation in a 3.5 assembly fails when linked in an application targeting 4.6
- parse / visualize DTD with Javascript
- Does PHP's "schemaValidate" function supportDTD parameter entities?
- Referenced file contains errors (http://users.tpg.com.au/ojburn/dtds/configuration_1_3.dtd)
- XML and DTD: The content of element type must match
- spring mvc processing xml with relative path to dtd
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You can add version information to a filename. Ex:
myapp_1_2.dtdif you load it from the file system or from a URL. You can parse the name and obtain the version.If that doesn't work in your scenario, you can use a Formal Public Identifier that can contain versioning information. To use it you will need to establish an XML Catalog.
A catalog is an XML file that maps FPIs to DTDs. It might already exist in your environment or server, so you will just need to edit it and add a new entry for each DTD. If not, you might need to write a catalog file and a catalog resolver for your application, and then register it with your parser.
A catalog file has this format:
With this set up, you can select your DTDs via
<!DOCTYPE root PUBLIC="-//MY GROUP//DTD MY APP V1.2//EN" />.See this article which has some starting points on how to set up a resolver, and search for "XML catalog" for other sources.
See also: Formal Public Identifiers and Catalogs