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.
How to specify a version for XML DTD?
359 Views Asked by gunner4evr At
1
There are 1 best solutions below
Related Questions in XML
- Impose component restriction to a series of parsys-CQ
- Wrong xml being inflated android
- Shorten the XSD
- Writing/Overwriting to specific XML file from ASP.NET code behind
- Magento custom block. Can't get block's file
- Layout not shifting up when keyboard is open
- CSV to XML XSLT: How to quote excape
- Getting deeply embedded XML element values
- Saving FileSystemInfo Array to File
- how to apply templates within xsl:for-each
- Spring - configure Jboss Intros for xml with java config?
- Problems with implementing custom actionbar android
- Can Apache Ant be told to cache its XML files?
- Is Log4j2 xml configuration case sensitive?
- How to get a specific node value in XML Pull Parser
Related Questions in XML-PARSING
- Getting deeply embedded XML element values
- groovy xml namespace definition used in attribute value lost after XmlParse/serialize
- Is this file an XML or HTML file? How can I parse it?
- How to find the end of an XML document in a stream with expat?
- How to get the value of mixed of array and objects
- LibXML : colon in removeAttribute and value in getAttribute
- Parsing xml in Javascript iterate through child nodes
- XML External Entity Injection (Input Validation and Representation, Data Flow)
- What is the best way to replace the punctuation in tag names?
- How to print an empty XML element in perl
- Acessing elements from AMAZON XML API in Excel VBA
- xml parsing error (xpath, HTMLagilitypack)
- XML Namespace URI with HTTPS?
- Extracting data from xml in SQL query
- Parsing large XML file in R is very slow
Related Questions in DTD
- Which XML DTD is Valid
- Hibernate Tools - Not able to add configuration - dom4j connection Timedout -
- How to define dtd element with XOR
- DTD, #REQUIRED, #IMPLIED, Example
- Valid /Validated-Difference (XML,DTD)
- How to set system and public ID without validating or checking DTD?
- '&' inside element not validated by DTD how can i add in DTD to validate
- Why is it very important to specify DTD constraints for an XML document if the latter is treated by a JavaScript file?
- How to make two attributes in XML to be unique (DTD)
- SpringIntegration - disable DTD validation
- XML DTD Validate. Difference in Eclipse and other editors
- When generating beans from dtd with xjc default values are in getter methods
- Howto properly make dbunit reference a dtd file in the xml dataset?
- jaxb, how to get rid of unnecessary wrapping classes
- <!{CDATA[]]> and <ELEMENT> in a xml element
Related Questions in DTD-PARSING
- Hibernate Tools - Not able to add configuration - dom4j connection Timedout -
- How can I validate intermediate text via a DTD?
- Difference between 2 DTD tag
- entity in external xml dtd
- Use StAX to read DTD from one XML doc and write to another
- Transforming DTD's with Python
- how to reference the path to a DTD value in XML
- How to specify a version for XML DTD?
- How to validate an XML using inline DTD using libxml2 (SAX parser)?
- DTD validation in a 3.5 assembly fails when linked in an application targeting 4.6
- How to make Sarissa use a DTD when parsing XML?
- Does PHP's "schemaValidate" function supportDTD parameter entities?
- How to bypass parameter-entities resolution in DTD parsing
- Redefine DTD element
- What is the use of DTD in XML?
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)
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?
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