By default everything in XML is parsed character data(#PCDATA), then why do we need to specify #PCDATA in DTD. Somebody please explain. Thanks.
1
There are 1 answers
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 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 CDATA
- How do I create a custom PMD rule to check if a specific method is called?
- Chromium xmlString -> DOMParser() -> XMLSerializer() Round Trip Failure with Embedded CDATA
- Unable to Retrieve Data from Bullhorn to Power BI
- CData not rendered in browser
- Translating XML with CDATA using OpenAI GPT-4 and maintaining CDATA structure
- C# XML CDATA Save File
- Testing connections with custom drivers not supported (Salesforce JDBC)
- combining literals with variables in JSON (CDATA) with conditional statements
- identity transform of an xslt stylesheet embedded in CDATA
- How to generate with java a xml with CDATA on a specific field
- <![CDATA[ ]]> tag is missing after sending request from WCF test client
- Why CDATA fails to parse in XML 1.1?
- spark jdbc salesforce connection: invalid username, password, security token; or user locked out
- XML parser: quick way to parse everything inside an element as text?
- LXML don't want to parse text after comment
Related Questions in PCDATA
- How Can I create geo-referenced PCD map with KITTI Dataset Ground Truth Data
- CDATA inside PCDATA handling in XML
- XML validation of #PCDATA
- How to parse PCDATA and child element separately with PHP DOM?
- DTD Element: Alternative between text and element
- What is the use of PCDATA in XML?
- xml data always being created as CDATA and not PCDATA
- Importing graphml file into R igraph causes PCDATA invalid char value error
- RTF #PCDATA vs Document Text
- CDATA inside PCDATA
- PCDATA vs CDATA in XML DTD
- Why did XHTML have PCDATA inside script and style tags?
- DTD syntax - allow sub element OR pcdata
- What is this "PCDATA invalid Char value 11" error?
- pugixml node_cdata, node_pcdata set_value() invalid characters
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?
Popular Tags
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)
I'm not sure which of the following questions you are asking.
Question 1: What is the point of having a
#PCDATAkeyword in content models?As @mzjin has already pointed out, the
#PCDATAkeyword is used when declaring mixed content; it (or something logically equivalent to it) is needed in order to allow declarations to distinguish between elements which can contain character data, likeand elements which contain other elements, optionally separated by insignificant whitespace, but not character data, like
When you say "by default everything in XML is parsed character data", what do you mean? There is no 'default' declaration defined in XML for elements not declared in the DTD. Some processors may assume a declaration of that form for undeclared elements, in order to attempt to keep going while reading an invalid document, and that can be useful. But it's not a rule defined by XML.
Question 2: why is it called 'parsed' character data, when all character data in an XML document passed through a parser and is thus necessarily 'parsed'?
The keyword
PCDATA, inherited from ISO 8879 (which defines SGML), does indeed stand for 'parsed character data', but its denotation is narrower than you appear to be thinking. It means character data in which all potential delimiters will be recognized, including<!for comments and CDATA sections (and, in SGML, also for conditional sections)<for start-tags and sole-tags</for end-tags&#for numeric character references&for entity referencesThis property distinguishes parsed character data (in the technical sense) from two other kinds of character data, denoted by the keywords
RCDATA(replaceable character data) andCDATA(just character data), in which different sets of delimiters are recognized. (RCDATA is part of SGML, but not of XML.)In a CDATA marked section, for example, the only delimiter recognized is the end of the marked section,
]]>.In an attribute declared CDATA, the only delimiters recognized are
&,&#, and the closing quotation mark of the attribute-value specification (either"or').In an SGML document, marked sections can occur with the keyword
RCDATA; in them, entity references (&, numeric character references (&#), and the marked-section end delimiter (]]>) will be recognized, but not start- and end-tag open delimiters (and, if I'm reading 8879 right, also not marked-section open delimiters<![).You may make the case that the terminology chosen in 8879 is perhaps not as clear as it might be, and that clearer terminology might have been possible and helpful. If so, you would not be the first to say so.