I believe I have run into a bug in Crimson. I get an exception when I try to import a 
DocumentFragment node that contains a child element which has attributes. 

Here's the output for the test case I've isolated:
-------------------------------------------
D:\J\Projects\bco>java DOMImportTest
org.apache.crimson.tree.DomEx: HIERARCHY_REQUEST_ERR: This node isn't allowed there.
        at org.apache.crimson.tree.XmlDocument.changeNodeOwner(XmlDocument.java:1156)
        at org.apache.crimson.tree.XmlDocument.importNode(XmlDocument.java:1293)
        at DOMImportTest.main(DOMImportTest.java:72)
FAILED to import and/or insert <DF1> doc frag!
Imported and inserted <DF2> doc frag successfully!
Imported and inserted NON-doc frag successfully!
-------------------------------------------

I'm also attaching a small program that reproduces the bug as well as a test doc. If 
what I'm seeing is not a bug can someone explain why this is reasonable behavior? 

Thanks for your time.


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the 
convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

DOMImportTest.class

<?xml version="1.0" standalone="yes"?>
<MYDOC>
  <!-- 
    This element will be appended to a DocumentFragment, imported to the 
    target doc and appended there. It's child elements HAVE attributes
    and the import will thus fail.
  -->
  <DF1>this is some text <b><font size="2" color="#ff0000">that tells you what to do</font></b> and where to do it.</DF1>
  
  <!-- 
    This element will be appended to a DocumentFragment, imported to the 
    target doc and appended there. It's child elements have NO attributes
    and the import will thus succeed.
  -->
  <DF2>this is some text <b><font>that tells you what to do</font></b> and where to do it.</DF2>

  <!-- This element will be imported to the target doc and appended there. -->
  <NON_DF>this is some text <b><font size="2" color="#ff0000">that tells you what to do</font></b> and where to do it.</NON_DF>
</MYDOC>

---------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to