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 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 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 CDATA
- How to manipulate xml tag in xslt which contains xml tag along with its attributes as its attribute?
- How do I include a CDATA section in a WCF client webservice call in .Net?
- CDATA showing up in my HTML page. Why?
- Difference between adding <![CDATA[ in page source v/s dynamically using javascript
- In XML, Can CData exist alongside another node?
- How can SOAPMessage parse <![CDATA[ ]]>?
- How to properly read a CDATA section in java using SAX parser
- Excel VBA to click submit javascript
- How to format CData text?
- IIB SOAP Service CDATA element to MQ
- Parsing CDATA string to XCDATA
- Why isn't CDATA protecting my javascript code from the HTML validator?
- How to get XPath query in response from SOAPUI
- Accessing CDATA values in a simplexmliterator
- How to build string in xml format using Xquery or XSLT
Related Questions in PCDATA
- PCDATA vs CDATA in XML DTD
- XML validation of #PCDATA
- pugixml node_cdata, node_pcdata set_value() invalid characters
- Importing graphml file into R igraph causes PCDATA invalid char value error
- What is this "PCDATA invalid Char value 11" error?
- How to parse PCDATA and child element separately with PHP DOM?
- RTF #PCDATA vs Document Text
- CDATA inside PCDATA
- what actually is PCDATA and CDATA?
- DTD syntax - allow sub element OR pcdata
- Problem with xml
- Element Declaration: Defining content as #PCDATA and one occurence of child element
- Why is this not a valid XML DTD? (Parameter entity and #PCDATA)
- Questions for making a MySQL table from a DTD file
- DTD Element: Alternative between text and element
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?
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.