[jdom-interest] Attribute types

Alex Rosen arosen at silverstream.com
Wed Sep 5 16:56:30 PDT 2001


Does XSchema (or other schema schemes) have this notion? If DTDs are going
to be less used in the future, perhaps we wouldn't want to complicate the
API for this.

Alex

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Elliotte
> Rusty Harold
> Sent: Tuesday, September 04, 2001 11:58 AM
> To: jdom-interest at jdom.org
> Subject: [jdom-interest] Attribute types
>
>
> I think the Attribute class should have a getType() method
> which returns the type of the attribute, CDATA by default;
> NMTOKEN, NMTOKENS, ID, etc. if the DTD says otherwise and the
> parser is reading the DTD. Among other applications this is
> necessary for implementing XPath/XPointer/XSLT which all need
> access to ID type attributes and for XInclude which needs
> access to attributed declared to be unparsed entity or notation.
>
>
> We could return this as a String; e.g.:
>
> public String getType()
>
> or as an instance of an enumerated AttributeType class.
>
> Changes to attribute would be minor (one new immutable field,
> one new method, and probably one additional constructor).
> Changes to XMLOutputter would be non existent. Most of the
> work to support this would have to go into SAXBuilder.
>
> Note that this cannot be supported in DOMBuilder because DOM
> does not expose this information. Additional plus is this
> lets JDOM do something the DOM can't.
>
> Thoughts? Commments? Is there any significant downside to adding this?
> --
>
> +-----------------------+------------------------+-------------------+
> | Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
> +-----------------------+------------------------+------------
> -------+
> |          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
> |              http://www.ibiblio.org/xml/books/bible2/              |
> |   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
> +----------------------------------+---------------------------------+
> |  Read Cafe au Lait for Java News:
http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list