[jdom-interest] SAXBuilder changing attribute values

Chet Rebman chet.rebman at du.edu
Fri Mar 26 13:57:22 PDT 2010


Hello I have a web application with Xerces-J 2.9.1 and JDOM Implementation-Version: 1.1.1

The problem is when creating the DOM  the type attribute values change to "simple" even though
the attributes values are valid according to the schema and the data is contained within an <mets:xmlData>
element. The input file is valid METS and contains xmlData elements in order to embed valid MODS. The
The entire document and all subsections validate and schema check via other tools such as the 
Oxygen XML editor. If I read the xml file in and create a DOM which I immediately write out to disk, all
of the 'type' attributes have been set to type="simple"

HERE IS HOW I CREATE THE DOM....

SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser", validate );
builder.setFeature("http://apache.org/xml/features/validation/schema", schemaCheck );
xmlDoc = builder.build( new FileInputStream( xmlFile ) );   


INPUT FILE SNIPIT....

  <mets:dmdSec ID="ED22T222003INTERNET.id2">
    <mets:mdWrap MDTYPE="MODS" MIMETYPE="text/xml">
      <mets:xmlData>
        <mods:mods xmlns:mods="http://www.loc.gov/mods/v3">
          <mods:titleInfo ">
            <mods:title>Teacher supply and demand in the state of Colorado :</mods:title>
          </mods:titleInfo>
          <mods:name type="personal">
            <mods:namePart>Reichardt, Robert E.</mods:namePart>
            <mods:role>
              <mods:roleTerm authority="marcrelator" type="text">creator</mods:roleTerm>
            </mods:role>
          </mods:name>
          <mods:name type="personal">
            <mods:namePart>Akiba, Motoko.</mods:namePart>
            <mods:role>
              <mods:roleTerm authority="marcrelator" type="text">contributor</mods:roleTerm>
            </mods:role>
          </mods:name>
          <mods:name type="personal">
            <mods:namePart>Van Buhler, Becky.</mods:namePart>
            <mods:role>
              <mods:roleTerm authority="marcrelator" type="text">contributor</mods:roleTerm>
            </mods:role>
           </mods:name>
           <mods:name type="corporate">
            <mods:namePart>Colorado, </mods:namePart>
            <mods:namePart>Dept. of Education.</mods:namePart>
            <mods:role>
               <mods:roleTerm authority="marcrelator" type="text">corp contributor</mods:roleTerm>
            </mods:role>
          </mods:name>
        </mods:mods>
     </mets:xmlData>
   </mets:mdWrap>
</mets:dmdSec>

OUTPUT FILE SNIPIT....

  <mets:dmdSec ID="ED22T222003INTERNET.id2">
    <mets:mdWrap MDTYPE="MODS" MIMETYPE="text/xml">
      <mets:xmlData>
        <mods:mods xmlns:mods="http://www.loc.gov/mods/v3">
          <mods:titleInfo type="simple">
            <mods:title>Teacher supply and demand in the state of Colorado :</mods:title>
          </mods:titleInfo>
          <mods:name type="simple">
            <mods:namePart>Reichardt, Robert E.</mods:namePart>
            <mods:role>
              <mods:roleTerm authority="marcrelator" type="text">creator</mods:roleTerm>
            </mods:role>
          </mods:name>
          <mods:name type="simple">
            <mods:namePart>Akiba, Motoko.</mods:namePart>
            <mods:role>
              <mods:roleTerm authority="marcrelator" type="text">contributor</mods:roleTerm>
            </mods:role>
          </mods:name>
          <mods:name type="simple">
            <mods:namePart>Van Buhler, Becky.</mods:namePart>
            <mods:role>
              <mods:roleTerm authority="marcrelator" type="text">contributor</mods:roleTerm>
            </mods:role>
            <mods:name type="simple">
               <mods:namePart>Colorado, </mods:namePart>
               <mods:namePart>Dept. of Education.</mods:namePart>
               <mods:role>
                <mods:roleTerm authority="marcrelator" type="text">corp contributor</mods:roleTerm>
              </mods:role>
          </mods:name>
          </mods:name></mods:mods>
      </mets:xmlData>
    </mets:mdWrap>
  </mets:dmdSec>


More information about the jdom-interest mailing list