public class DTDStore extends Object
DTDStore.DTDObjectContainer
.
At the moment this class uses the com.wutka DTD parser. We've also tried some
other DTD parsers but they all had the same missing feature which was that they
didn't keep attribute typing info (implemented using entities). This would
be a very valuable feature for the purposes of this module.
Example:<!ELEMENT html (head, body)> <!ATTLIST html %i18n; id ID #IMPLIED xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml' >where URI is defined as:
<!ENTITY % URI "CDATA"> <!-- a Uniform Resource Identifier, see [RFC2396] -->If this information was available we could target
ContentHandler
s
at elements containing "URI" attributes.
Another examples of this idea of using DTD ENTITY definitions to target
ContentHandler
s at specific elements (rather than using the element names)
might be using ENTITYs like the following (from http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd):
<!ENTITY % heading "h1|h2|h3|h4|h5|h6"> <!ENTITY % lists "ul | ol | dl | menu | dir"> <!ENTITY % blocktext "pre | hr | blockquote | address | center | noframes"> <!ENTITY % block "p | %heading; | div | %lists; | %blocktext; | isindex |fieldset | table"> <!-- %Flow; mixes block and inline and is used for list items etc. --> <!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
Modifier and Type | Class and Description |
---|---|
static class |
DTDStore.DTDObjectContainer
Container class for the underlying DTD implementation.
|
Constructor and Description |
---|
DTDStore() |
Modifier and Type | Method and Description |
---|---|
static void |
addDTD(ProfileSet profileSet,
InputStream stream)
Add the DTD for the profileSet device
|
static DTDStore.DTDObjectContainer |
getDTDObject(ProfileSet profileSet)
Get the DTD Object for the profile, wrapped in a
DTDStore.DTDObjectContainer
instance. |
public static void addDTD(ProfileSet profileSet, InputStream stream)
profileSet
- Device Contextstream
- DTD data stream.public static DTDStore.DTDObjectContainer getDTDObject(ProfileSet profileSet)
DTDStore.DTDObjectContainer
instance.profileSet
- Profile set.Copyright © 2020. All rights reserved.