You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by ta...@shalif.com on 2000/10/12 11:20:02 UTC

why aren't default attributes created when using schema?

The default attributes are created alright for the document as a whole
when reading in and parsing the test-schema.xml. However, when I try
to create an individual element - e.g. doc.createElement("bula")
the default attributes are not created in the new element. This
problem dosn't happen with my test-dtd.xml, using DTD via the
<!DOCTYPE declaration. 

------------------------------ test.xsd ------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<schema>
<element name="test">
  <complexType>
     <element ref="bula"/>
  </complexType>
</element>
<element name="bula">
  <complexType base="string" derivedBy="extension">
    <attribute name="bula" type="string" use="fixed" value="aha"/>
  </complexType>
</element>
</schema>
----------------------------------------------------------------------
------------------------------ test.dtd ------------------------------
<!ELEMENT test (bula+)>
<!ELEMENT  bula   (#PCDATA)>
<!ATTLIST  bula bula CDATA #FIXED "aha">
----------------------------------------------------------------------

-- 
-- Regards,
   Tal.
--------------------------------------------------
       A Nargila a day keeps the doctor away.
               Email: tal + @ + shalif.com
             mobile: +81-(0)70-5659-9152
--------------------------------------------------