[ 
http://issues.apache.org/jira/browse/XALANJ-2219?page=comments#action_12415935 
] 

Jesse Glick commented on XALANJ-2219:
-------------------------------------

Figured out I can test without using the IBM JDK. As a control, download 
Xalan-J 2.7.0 and try to run NB with that in bootcp:

rm -rfv /tmp/test-xalanj-2219; /space/nb/nb50/bin/netbeans --userdir 
/tmp/test-xalanj-2219 
-J-Xbootclasspath/p:/tmp/xalan-j_2_7_0/xalan.jar:/tmp/xalan-j_2_7_0/serializer.jar:/tmp/xalan-j_2_7_0/xercesImpl.jar

As expected, it fails: a dialog appears instructing you that the IDE is using a 
buggy version of Xalan and then the IDE shuts down.

Using SVN trunk sources of xalan, patched with the above patch:

rm -rfv /tmp/test-xalanj-2219; /space/nb/nb50/bin/netbeans --userdir 
/tmp/test-xalanj-2219 
-J-Xbootclasspath/p:/tmp/xalan/build/xalan.jar:/tmp/xalan/build/serializer.jar:/tmp/xalan-j_2_7_0/xercesImpl.jar

this no longer occurs. The IDE starts up and lets you make a project. However 
it is still broken, just differently. The project.xml which is generated ought 
to look like this:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1";>
    <type>org.netbeans.modules.java.j2seproject</type>
    <configuration>
        <data xmlns="http://www.netbeans.org/ns/j2se-project/3";>
            <name>JavaApplication1</name>
            <minimum-ant-version>1.6.5</minimum-ant-version>
            <source-roots>
                <root id="src.dir"/>
            </source-roots>
            <test-roots>
                <root id="test.src.dir"/>
            </test-roots>
        </data>
    </configuration>
</project>

However it instead looks like this:

<?xml version="1.0" encoding="UTF-8"?><project 
xmlns="http://www.netbeans.org/ns/project/1";>
    <type>org.netbeans.modules.java.j2seproject</type>
    <configuration>
        <data xmlns="http://www.netbeans.org/ns/j2se-project/3";>
            <name 
xmlns="http://www.netbeans.org/ns/project/1";>JavaApplication1</name>
            <minimum-ant-version 
xmlns="http://www.netbeans.org/ns/project/1";>1.6.5</minimum-ant-version>
            <source-roots xmlns="http://www.netbeans.org/ns/project/1";>
                <root xmlns="http://www.netbeans.org/ns/j2se-project/3"; 
id="src.dir"/>
            </source-roots>
            <test-roots xmlns="http://www.netbeans.org/ns/project/1";>
                <root xmlns="http://www.netbeans.org/ns/j2se-project/3"; 
id="test.src.dir"/>
            </test-roots>
        </data>
    </configuration>
</project>

Note the unwanted xmlns attrs inside <data>. If it is not obvious what is wrong 
please let me know and I will try to come up with an additional test case.

> Namespace of child element written incorrectly as root namespace
> ----------------------------------------------------------------
>
>          Key: XALANJ-2219
>          URL: http://issues.apache.org/jira/browse/XALANJ-2219
>      Project: XalanJ2
>         Type: Bug

>   Components: Serialization
>     Versions: 2.6, 2.5, 2.7
>  Environment: Linux m2 2.6.13-1.1532_FC4 #1 Thu Oct 20 01:30:08 EDT 2005 i686 
> i686 i386 GNU/Linux
> java version "1.5.0_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
>     Reporter: Jesse Glick
>     Assignee: Brian Minchau
>  Attachments: ToStream.patch2.txt
>
> Run this class:
> ---%<---
> import java.io.StringReader;
> import javax.xml.parsers.DocumentBuilderFactory;
> import javax.xml.transform.Result;
> import javax.xml.transform.Source;
> import javax.xml.transform.Transformer;
> import javax.xml.transform.TransformerFactory;
> import javax.xml.transform.dom.DOMSource;
> import javax.xml.transform.stream.StreamResult;
> import javax.xml.transform.stream.StreamSource;
> import org.w3c.dom.Document;
> import org.xml.sax.InputSource;
> public class Test {
>     private static final String IDENTITY_XSLT_WITH_INDENT =
>             "<xsl:stylesheet version='1.0' " +
>             "xmlns:xsl='http://www.w3.org/1999/XSL/Transform' " +
>             "xmlns:xalan='http://xml.apache.org/xslt' " +
>             "exclude-result-prefixes='xalan'>" +
>             "<xsl:output method='xml' indent='yes' xalan:indent-amount='4'/>" 
> +
>             "<xsl:template match='@*|node()'>" +
>             "<xsl:copy>" +
>             "<xsl:apply-templates select='@*|node()'/>" +
>             "</xsl:copy>" +
>             "</xsl:template>" +
>             "</xsl:stylesheet>";
>     public static void main(String[] args) throws Exception {
>         String data = "<root xmlns='root'/>";
>         Document doc = 
> DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new 
> InputSource(new StringReader(data)));
>         /*
>         Document doc = 
> DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplementation().createDocument("root",
>  "root", null);
>          */
>         doc.getDocumentElement().appendChild(doc.createElementNS("child", 
> "child"));
>         Transformer t = TransformerFactory.newInstance().newTransformer(
>                 new StreamSource(new 
> StringReader(IDENTITY_XSLT_WITH_INDENT)));
>         Source source = new DOMSource(doc);
>         Result result = new StreamResult(System.out);
>         t.transform(source, result);
>     }
> }
> ---%<---
> Just using plain JDK 5.0 JAXP, I get the expected
> ---%<---
> <?xml version="1.0" encoding="UTF-8"?>
> <root xmlns="root">
>     <child xmlns="child"/>
> </root>
> ---%<---
> If I add Xalan-J to the classpath, I get
> ---%<---
> <?xml version="1.0" encoding="UTF-8"?>
> <root xmlns="root">
>     <child xmlns="root"/>
> </root>
> ---%<---
> Note the incorrect namespace on the child element.
> This is true in Xalan 2.5.2, 2.6.0, 2.7.0, and dev builds 
> (xalan-gump-24102005.jar).
> Prevents Xalan from being bundled with the NetBeans IDE, as it causes 
> incorrectly written project metadata:
> http://www.netbeans.org/issues/show_bug.cgi?id=66563
> If you use newTransformer() with no stylesheet the problem goes away (though 
> of course you lose indentation unless it is readded using setOutputProperty). 
> Also if the Document is created in memory rather than parsed (see 
> commented-out code) the problem goes away.
> Does not seem to be reproducible in JDK 6, I don't know why.
> Inclusion of the bundled Xerces in the classpath does not appear to make any 
> difference.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to