Re: [gdome]Re: DOM compliance, bugs



On Fri, Oct 26, 2001 at 03:14:06PM +0200, Tobias Peters wrote:
> Hi,
> 
> look at this excerpt from the Document::createElement method:
> 
> > In addition, if there are known attributes with default values, Attr
> > [p.51] nodes representing them are automatically created and attached to
> > the element.
> 
> "there are known attributes with default values" means to me, the document
> has been loaded in validating mode, and there was an <!ATTLIST ...>
> declaration with a default value in the dtd.
> 
> This is not currently implemented by gdome2. Is it even possible to
> extract the necessary information from libxml?

  Of course. 
The parser can either load or not DTd and external entities
The parser can either generate xmlAttr for the defaulted values
or you can query the Dtd if present, see xmlGetProp code it does
this by default.

 For example the XSLT library:
   1/ forces reading the DTD and external entities
   2/ ask for defaulted attributes to be directly available in the
      tree.

------- from lixslt/xsltproc/xsltproc.c ------
  xmlSubstituteEntitiesDefault(1);
  xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
-----------------------------------------------

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]